CLI: move the 'repl' command to 'tahoe debug repl'

This commit is contained in:
Brian Warner 2008-08-12 13:40:17 -07:00
parent bb33e3e4c2
commit 1711b5591f
3 changed files with 12 additions and 11 deletions

View File

@ -352,7 +352,7 @@ aspect of this command is to reveal the storage index for any given URI. This
can be used to locate the share files that are holding the encoded+encrypted
data for this file.
"tahoe repl" will launch an interactive python interpreter in which the Tahoe
packages and modules are available on sys.path (e.g. by using 'import
"tahoe debug repl" will launch an interactive python interpreter in which the
Tahoe packages and modules are available on sys.path (e.g. by using 'import
allmydata'). This is most useful from a source tree: it simply sets the
PYTHONPATH correctly and runs the 'python' executable.

View File

@ -194,9 +194,6 @@ class WebopenOptions(VDriveOptions):
longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive."""
class ReplOptions(usage.Options):
pass
subCommands = [
["mkdir", None, MakeDirectoryOptions, "Create a new directory"],
["add-alias", None, AddAliasOptions, "Add a new alias cap"],
@ -210,7 +207,6 @@ subCommands = [
["mv", None, MvOptions, "Move a file within the virtual drive."],
["ln", None, LnOptions, "Make an additional link to an existing file."],
["webopen", None, WebopenOptions, "Open a webbrowser to the root_dir"],
["repl", None, ReplOptions, "Open a python interpreter"],
]
def mkdir(options):
@ -297,10 +293,6 @@ def webopen(options, opener=None):
opener(url)
return 0
def repl(options):
import code
return code.interact()
dispatch = {
"mkdir": mkdir,
"add-alias": add_alias,
@ -314,6 +306,5 @@ dispatch = {
"mv": mv,
"ln": ln,
"webopen": webopen,
"repl": repl,
}

View File

@ -562,6 +562,14 @@ def catalog_shares(config, out=sys.stdout, err=sys.stderr):
return 0
class ReplOptions(usage.Options):
pass
def repl(options, out=sys.stdout, err=sys.stderr):
import code
return code.interact()
class DebugCommand(usage.Options):
subCommands = [
["dump-share", None, DumpOptions,
@ -569,6 +577,7 @@ class DebugCommand(usage.Options):
["dump-cap", None, DumpCapOptions, "Unpack a read-cap or write-cap"],
["find-shares", None, FindSharesOptions, "Locate sharefiles in node dirs"],
["catalog-shares", None, CatalogSharesOptions, "Describe shares in node dirs"],
["repl", None, ReplOptions, "Open a python interpreter"],
]
def postOptions(self):
if not hasattr(self, 'subOptions'):
@ -594,6 +603,7 @@ subDispatch = {
"dump-cap": dump_cap,
"find-shares": find_shares,
"catalog-shares": catalog_shares,
"repl": repl,
}