Adata interactive interpreter
See also
Commands(app)¶Bases: cmd2.Cmd
Adata interactive interpreter: execute command, script or code.
Define new commands creating do_ methods.
| Parameters: | app (adata.core.Application) – The main application. |
|---|
About cmd2: An easy but powerful framework for writing line-oriented command interpreters.
Extends the Python Standard Library’s cmd package by adding a lot of useful features to the out of the box configuration.
Line-oriented command interpreters are often useful for test harnesses, internal tools, and rapid prototypes.
Prompt(console)¶Attach a interactive input handler to a Console instance.
| Parameters: | console (adata.gui.text.Console) – The console. |
|---|---|
| Returns: | self |
| Return type: | Commands |
do_dir(args)¶usage: dir [-h] [-f [FILTER]] [something]
Attributes table.
| -h, --help | show this help message and exit |
do_module(name)¶Load or reload a python module.
| Parameters: | cmd (string) – Module name. |
|---|---|
| Returns: | Module imported without errors |
| Return type: | bool |
is_command(keyword)¶Does a do_name method exist?
| Returns: | Attribute exists. |
|---|---|
| Return type: | bool |
iter_scripts()¶List file names in the /scripts folder.
poutput(msg, end='\n')¶Adata override of cmd2.Cmd.poutput method: print to console.
default_to_shell = False¶dir_parser = ArgumentParser(prog='dir', usage=None, description='Attributes table.', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)¶stdout = <adata.pubsub.Output object>¶Interpreter(locals=None)¶Bases: code.InteractiveInterpreter
Base class for InteractiveConsole.
This class deals with parsing and interpreter state (the user’s namespace); it doesn’t deal with input buffering or prompting or input file naming (the filename is always passed in explicitly).
write(text)¶Adata override: pubsub event send.
| Parameters: | text – Output |
|---|
dir_pretty(var, grep=None)¶Pretty dir command
read_file(path, encoding='utf-8')¶Prints a text file
visit(url)¶Test web page text - locals() available