bokeh.application.handlers.code_runner¶
Provide a utility class CodeRunner
for use by handlers that execute
Python source code.
-
class
CodeRunner
(source, path, argv, package=None)[source]¶ Compile and run Python source code.
-
__init__
(source, path, argv, package=None)[source]¶ - Parameters
- Raises
ValueError, if package is specified for an __init__.py –
-
run
(module, post_check=None)[source]¶ Execute the configured source code in a module and run any post checks.
- Parameters
module (Module) – A module to execute the configured code in.
post_check (callable, optional) – A function that raises an exception if expected post-conditions are not met after code execution.
-
property
error
¶ If code execution fails, may contain a related error message.
-
property
error_detail
¶ If code execution fails, may contain a traceback or other details.
-
property
failed
¶ True
if code execution failed
-
property
path
¶ The path that new modules will be configured with.
-
property
source
¶ The configured source code that will be executed when
run
is called.
-