added a 'repl' command to tahoe.exe

this is probably not of very high utility in the unix case of bin/tahoe
but is useful when working with native builds, e.g. py2exe's tahoe.exe,
to examine and debug the runtime environment, linking problems etc.
This commit is contained in:
robk-tahoe 2008-01-09 19:19:52 -07:00
parent 33715f3ba3
commit 08f445a562

View File

@ -120,6 +120,9 @@ class WebopenOptions(VDriveOptions):
longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive.""" longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive."""
class ReplOptions(usage.Options):
pass
subCommands = [ subCommands = [
["ls", None, ListOptions, "List a directory"], ["ls", None, ListOptions, "List a directory"],
["get", None, GetOptions, "Retrieve a file from the virtual drive."], ["get", None, GetOptions, "Retrieve a file from the virtual drive."],
@ -127,6 +130,7 @@ subCommands = [
["rm", None, RmOptions, "Unlink a file or directory in the virtual drive."], ["rm", None, RmOptions, "Unlink a file or directory in the virtual drive."],
["mv", None, MvOptions, "Move a file within the virtual drive."], ["mv", None, MvOptions, "Move a file within the virtual drive."],
["webopen", None, WebopenOptions, "Open a webbrowser to the root_dir"], ["webopen", None, WebopenOptions, "Open a webbrowser to the root_dir"],
["repl", None, ReplOptions, "Open a python interpreter"],
] ]
def list(config, stdout, stderr): def list(config, stdout, stderr):
@ -209,6 +213,10 @@ def webopen(config, stdout, stderr):
webbrowser.open(url) webbrowser.open(url)
return 0 return 0
def repl(config, stdout, stderr):
import code
return code.interact()
dispatch = { dispatch = {
"ls": list, "ls": list,
"get": get, "get": get,
@ -216,5 +224,6 @@ dispatch = {
"rm": rm, "rm": rm,
"mv": mv, "mv": mv,
"webopen": webopen, "webopen": webopen,
"repl": repl,
} }