workflow#
Alfred Workflow module.
- afwf.workflow.log_last_error()[source]#
Log the last exception trace back info to
~/.alfred-afwf/last-error.txt
file.
- afwf.workflow.log_debug_info(info: str)[source]#
Call this function anywhere. It will append the
info
string to the end of~/.alfred-afwf/debug.txt
file.
- class afwf.workflow.Workflow(handlers: Dict[str, Handler] = _Nothing.NOTHING)[source]#
Represents an Alfred Workflow object. The workflow can register many handlers.
Each handler will be responsible for a Script Filter implementation.
[CN]
表示一个 Alfred Workflow 对象. 一个 workflow 可以注册多个 handler. 每个 handler 对应着一个 Script Filter 的实现.
- run(arg: Optional[str] = None, debug: bool = False)[source]#
High level script filter runner.
- Parameters:
debug – flag to turn on debug.
By default, it provides two ways to debug:
- Automatically log the sys.argv, handler id and query string history to
~/.alfred-afwf/debug.txt
file.
- If python raises any exception, log the Exception trace back message
to
~/.alfred-afwf/last-error.txt. And show two item to allow user to open the ``debug.txt
orlast-error.txt
file.