polytracker.repl¶
repl classes¶
Commands¶
- class polytracker.repl.Commands(argument_parser: ArgumentParser)¶
Bases:
Command
- __init__(argument_parser: ArgumentParser)¶
- __init_arguments__(parser: ArgumentParser)¶
Initializes this command’s argument parser.
Subclasses should extend this function and add any necessary options to
parser
.
- extension_types: Optional[List[Type[CommandExtension]]] = None¶
An auto-populated list of eny extensions to this command.
- extensions: List[CommandExtension]¶
- parent: Optional['Plugin']¶
The parent of this plugin, if it is a sub-plugin.
- parent_parsers: Tuple[ArgumentParser, ...] = ()¶
An optional sequence of parent argument parsers from which to parse options.
- run(args)¶
Callback for when the command is run.
- Parameters:
args – The result of parsing the commandline arguments set up by
Command.__init_arguments__()
.
- subcommand_types: Optional[List[Type[Subcommand]]] = None¶
An auto-populated list of subcommands of this command.
- subcommands: List[Subcommand]¶
PolyTrackerCompleter¶
- class polytracker.repl.PolyTrackerCompleter(repl: PolyTrackerREPL)¶
Bases:
Completer
- __init__(repl: PolyTrackerREPL)¶
- bottom_toolbar()¶
- get_completions(document, complete_event)¶
This should be a generator that yields
Completion
instances.If the generation of completions is something expensive (that takes a lot of time), consider wrapping this Completer class in a ThreadedCompleter. In that case, the completer algorithm runs in a background thread and completions will be displayed as soon as they arrive.
- Parameters:
document –
Document
instance.complete_event –
CompleteEvent
instance.
- async get_completions_async(document: Document, complete_event: CompleteEvent) AsyncGenerator[Completion, None] ¶
Asynchronous generator for completions. (Probably, you won’t have to override this.)
Asynchronous generator of
Completion
objects.
- rprompt()¶
PolyTrackerREPL¶
- class polytracker.repl.PolyTrackerREPL¶
Bases:
object
- __init__()¶
- commands: Dict[str, REPLCommand] = {'commands': <polytracker.repl.REPLCommand object>, 'docker_run': <polytracker.repl.REPLCommand object>, 'extract_grammar': <polytracker.repl.REPLCommand object>, 'load_trace_tdag': <polytracker.repl.REPLCommand object>}¶
- classmethod commands_command()¶
print the PolyTracker commands
- classmethod current_instance() PolyTrackerREPL ¶
- print_exc()¶
- classmethod register(command_name: str, discardable: bool = False)¶
Function decorator for registering a command with this REPL
- registered_globals: Dict[str, Any] = {'CAN_RUN_NATIVELY': False, 'commands': <polytracker.repl.REPLCommand object>, 'docker_run': <polytracker.repl.REPLCommand object>, 'extract_grammar': <polytracker.repl.REPLCommand object>, 'load_trace_tdag': <polytracker.repl.REPLCommand object>}¶
- run()¶
- run_on_exit(function: Callable[[], Any])¶
Registers a function to be executed when this REPL completes
- run_python(command)¶