The command module provides Commands and Arguments for defining commands.
It also provides CommandExit and subclasses for communicating command completion information between hooke.engine.CommandEngines and hooke.ui.UserInterfaces.
Structured user input for Commands.
TODO: ranges for count?
Methods
help | |
validate |
Return a help message describing the Argument.
name_fn(internal_name) -> external_name gives calling hooke.ui.UserInterfaces a means of changing the display names if it wants (e.g. to remove spaces from command line tokens).
If value is not appropriate, raise ValueError.
One-line command description here.
>>> c = Command(name='test', help='An example Command.')
>>> hooke = None
>>> status = c.run(hooke, NullQueue(), PrintQueue(),
... help=True)
ITEM:
Command: test
<BLANKLINE>
Arguments:
<BLANKLINE>
help BOOL (bool) Print a help message.
stack BOOL (bool) Add this command to appropriate command stacks.
<BLANKLINE>
An example Command.
ITEM:
<BLANKLINE>
Methods
handle_arguments | |
help | |
run |
Normalize and validate input parameters (Argument values).
Return a help message describing the Command.
name_fn(internal_name) -> external_name gives calling hooke.ui.UserInterfaces a means of changing the display names if it wants (e.g. to remove spaces from command line tokens).
Normalize inputs and handle <Argument help> before punting to :meth:`_run.
The command requests an end to the interpreter session.
The queue.Queue equivalent of /dev/null.
This is a bottomless pit. Items go in, but never come out.
Methods
empty | |
full | |
get | |
get_nowait | |
join | |
put | |
put_nowait | |
qsize | |
task_done |
Raise queue.Empty.
There’s really no need to override the base Queue.get, but I want to know if someone tries to read from a NullQueue. With the default implementation they would just block silently forever :(.
Dump an item into the void.
Block and timeout are meaningless, because there is always a free slot available in a bottomless pit.
Debugging NullQueue that prints items before dropping them.
Methods
empty | |
full | |
get | |
get_nowait | |
join | |
put | |
put_nowait | |
qsize | |
task_done |
Print item and then dump it into the void.