added some handy default commands
This commit is contained in:
parent
2e5a553736
commit
efa1403380
13
Rex.py
13
Rex.py
@ -70,8 +70,6 @@ import pprint
|
|||||||
|
|
||||||
async def test():
|
async def test():
|
||||||
print("pokemon go")
|
print("pokemon go")
|
||||||
async def close():
|
|
||||||
exit()
|
|
||||||
async def nA():
|
async def nA():
|
||||||
print("this is a test")
|
print("this is a test")
|
||||||
async def nB():
|
async def nB():
|
||||||
@ -88,11 +86,20 @@ async def question():
|
|||||||
await rex.ask("What is your question? ")
|
await rex.ask("What is your question? ")
|
||||||
|
|
||||||
|
|
||||||
|
class stdCmds:
|
||||||
|
async def close():
|
||||||
|
exit()
|
||||||
|
|
||||||
|
async def debug():
|
||||||
|
from ptpdb import set_trace
|
||||||
|
set_trace()
|
||||||
|
|
||||||
# This is an example (the default) cmd-dict
|
# This is an example (the default) cmd-dict
|
||||||
|
|
||||||
defaultCmds = {
|
defaultCmds = {
|
||||||
|
"exit": stdCmds.close,
|
||||||
|
"debug": stdCmds.debug,
|
||||||
"test": test,
|
"test": test,
|
||||||
"exit": close,
|
|
||||||
"arg": arg,
|
"arg": arg,
|
||||||
"arg2": arg2,
|
"arg2": arg2,
|
||||||
"arg4": arg4,
|
"arg4": arg4,
|
||||||
|
2
TODO.txt
2
TODO.txt
@ -1,4 +1,4 @@
|
|||||||
- Syntax information in toolbar (configurable)
|
- Syntax information in toolbar (configurable)
|
||||||
- Allow other delimiters (e.g. ".")
|
- Allow other delimiters (e.g. ".")
|
||||||
- Support named arguments
|
- Support named arguments
|
||||||
- Include often used commands in a defaults collection (e.g. close)
|
- Include more often used commands in a defaults collection (e.g. close)
|
||||||
|
Loading…
Reference in New Issue
Block a user