aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-01-20 07:32:56 -0500
committerW. Trevor King <wking@drexel.edu>2010-01-20 07:32:56 -0500
commit116c6eb9e54dd223d715923dc6fb32e87a89aad6 (patch)
tree8fe1ad2539fe5e6281568335ad7aa494ce3925de /libbe
parent34b5bbd98e420672ecce64ba085bbf1a4205267e (diff)
downloadbugseverywhere-116c6eb9e54dd223d715923dc6fb32e87a89aad6.tar.gz
Fixed `be help` (used to raise NotImplementedError)
Diffstat (limited to 'libbe')
-rw-r--r--libbe/command/help.py2
-rw-r--r--libbe/ui/command_line.py14
2 files changed, 12 insertions, 4 deletions
diff --git a/libbe/command/help.py b/libbe/command/help.py
index 8e66405..1fc88f0 100644
--- a/libbe/command/help.py
+++ b/libbe/command/help.py
@@ -58,7 +58,7 @@ class Help (libbe.command.Command):
def _run(self, **params):
if params['topic'] == None:
if hasattr(self.ui, 'help'):
- self.ui.help()
+ print >> self.stdout, self.ui.help().rstrip('\n')
elif params['topic'] in libbe.command.commands():
module = libbe.command.get_command(params['topic'])
Class = libbe.command.get_command_class(module,params['topic'])
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index 17f7b35..9c97eec 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -250,6 +250,16 @@ class BE (libbe.command.Command):
def full_version(self, *args):
return libbe.version.version(verbose=True)
+class CommandLine (libbe.command.UserInterface):
+ def __init__(self, *args, **kwargs):
+ libbe.command.UserInterface.__init__(self, *args, **kwargs)
+ self.restrict_file_access = False
+ self.storage_callbacks = None
+ def help(self):
+ be = BE(ui=self)
+ self.setup_command(be)
+ return be.help()
+
def dispatch(ui, command, args):
parser = CmdOptionParser(command)
try:
@@ -273,9 +283,7 @@ def dispatch(ui, command, args):
def main():
io = libbe.command.StdInputOutput()
- ui = libbe.command.UserInterface(io)
- ui.restrict_file_access = False
- ui.storage_callbacks = None
+ ui = CommandLine(io)
be = BE(ui=ui)
ui.setup_command(be)