+# Copyright
+
"""Defines :class:`CommandLine` for driving Hooke from the command
line.
"""
If not, raise optparse.OptParseError().
"""
min_args = 0
- max_args = -1
+ max_args = 0
for argument in self.parser.command_args:
if argument.optional == False and argument.count > 0:
min_args += argument.count
default = True
if len(not_saved) > 0:
msg = 'Unsaved playlists (%s). %s' \
- % (', '.join(not_saved), msg)
+ % (', '.join([str(p) for p in not_saved]), msg)
default = False
outqueue.put(BooleanRequest(msg, default))
result = inqueue.get()
inqueue=ui_to_command_queue,
outqueue=command_to_ui_queue)
cmd.cmdloop(self._splash_text())
+
+ def run_lines(self, commands, ui_to_command_queue, command_to_ui_queue,
+ lines):
+ cmd = HookeCmd(self, commands,
+ inqueue=ui_to_command_queue,
+ outqueue=command_to_ui_queue)
+ for line in lines:
+ cmd.onecmd(line)