Updated copyright blurbs in all files to '# Copyright'
[hooke.git] / hooke / ui / commandline.py
index 57263dba9219a75a7e9c3379ab26988addd3fa87..7d090a38d1d58b8aaa130b640b21dc48e09a348a 100644 (file)
@@ -1,3 +1,5 @@
+# Copyright
+
 """Defines :class:`CommandLine` for driving Hooke from the command
 line.
 """
@@ -301,7 +303,7 @@ typing mistakes ;).
             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()
@@ -351,3 +353,11 @@ class CommandLine (UserInterface):
                        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)