jaffle.app.base¶
BaseJaffleApp¶
-
class
BaseJaffleApp
(app_conf_data)[source]¶ Base class for Jaffle apps.
-
completer_class
¶ The completer class for the interactive shell. It is required only if the app supports interactive shell.
-
lexer_class
¶ The lexer class for the interactive shell. It is required only if the app supports interactive shell.
-
classmethod
command_to_code
(app_name, command)[source]¶ Converts a command comes from
jaffle attach <app>
to a code to be executed.If the app supports
jaffle attach
, this method must be implemented.Parameters: - app_name (str) – App name defined in jaffle.hcl.
- command (str) – Command name received from the shell of
jaffle attach
.
Returns: code – Code to be executed.
Return type: str
-
execute_code
(code, *args, **kwargs)[source]¶ Executes a code.
Parameters: - code (str) – Code to be executed.
It will be formateed as
code.format(*args, **kwargs)
. - args (list) – Positional arguments to
code.format()
. - kwargs (dict) – Keyward arguments to
code.formmat()
.
Returns: future – Future which will have the execution result.
Return type: tornado.gen.Future
- code (str) – Code to be executed.
It will be formateed as
-