from twisted.internet import defer
from twisted.scripts import trial as twisted_trial
from foolscap.logging import cli as foolscap_cli
+from allmydata.scripts.common import BaseOptions
-class DumpOptions(usage.Options):
+class DumpOptions(BaseOptions):
def getSynopsis(self):
return "Usage: tahoe debug dump-share SHARE_FILENAME"
]
def getUsage(self, width=None):
- t = usage.Options.getUsage(self, width)
+ t = BaseOptions.getUsage(self, width)
t += """
Print lots of information about the given share, by parsing the share's
contents. This includes share type, lease information, encoding parameters,
-class DumpCapOptions(usage.Options):
+class DumpCapOptions(BaseOptions):
def getSynopsis(self):
return "Usage: tahoe debug dump-cap [options] FILECAP"
optParameters = [
self.cap = cap
def getUsage(self, width=None):
- t = usage.Options.getUsage(self, width)
+ t = BaseOptions.getUsage(self, width)
t += """
Print information about the given cap-string (aka: URI, file-cap, dir-cap,
read-cap, write-cap). The URI string is parsed and unpacked. This prints the
else:
print >>out, "unknown cap type"
-class FindSharesOptions(usage.Options):
+class FindSharesOptions(BaseOptions):
def getSynopsis(self):
return "Usage: tahoe debug find-shares STORAGE_INDEX NODEDIRS.."
self.nodedirs = map(argv_to_abspath, nodedirs)
def getUsage(self, width=None):
- t = usage.Options.getUsage(self, width)
+ t = BaseOptions.getUsage(self, width)
t += """
Locate all shares for the given storage index. This command looks through one
or more node directories to find the shares. It returns a list of filenames,
return 0
-class CatalogSharesOptions(usage.Options):
+class CatalogSharesOptions(BaseOptions):
"""
"""
return "Usage: tahoe debug catalog-shares NODEDIRS.."
def getUsage(self, width=None):
- t = usage.Options.getUsage(self, width)
+ t = BaseOptions.getUsage(self, width)
t += """
Locate all shares in the given node directories, and emit a one-line summary
of each share. Run it like this:
print >>err, "Error processing %s" % quote_output(si_dir)
failure.Failure().printTraceback(err)
-class CorruptShareOptions(usage.Options):
+class CorruptShareOptions(BaseOptions):
def getSynopsis(self):
return "Usage: tahoe debug corrupt-share SHARE_FILENAME"
]
def getUsage(self, width=None):
- t = usage.Options.getUsage(self, width)
+ t = BaseOptions.getUsage(self, width)
t += """
Corrupt the given share by flipping a bit. This will cause a
verifying/downloading client to log an integrity-check failure incident, and
-class ReplOptions(usage.Options):
+class ReplOptions(BaseOptions):
def getSynopsis(self):
return "Usage: tahoe debug repl"
return foolscap_cli.run_flogtool()
-class DebugCommand(usage.Options):
+class DebugCommand(BaseOptions):
subCommands = [
["dump-share", None, DumpOptions,
"Unpack and display the contents of a share (uri_extension and leases)."],
def getSynopsis(self):
return ""
def getUsage(self, width=None):
- #t = usage.Options.getUsage(self, width)
+ #t = BaseOptions.getUsage(self, width)
t = """Usage: tahoe debug SUBCOMMAND
Subcommands:
tahoe debug dump-share Unpack and display the contents of a share.