summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface/__main__.py46
-rwxr-xr-xinterface/input/tabcomp.py2
-rw-r--r--interface/interface.py7
3 files changed, 45 insertions, 10 deletions
diff --git a/interface/__main__.py b/interface/__main__.py
index 878b263..b1267c8 100644
--- a/interface/__main__.py
+++ b/interface/__main__.py
@@ -1,12 +1,48 @@
+#!/usr/bin/env python3
+
+import argparse as ap
import datetime as dt
import os
import sys
from .interface import Interface
-from .ola import OLAOutput
-#from .dummy import DummyOutput
-if len(sys.argv) > 2:
- raise ValueError("Usage: %s [workspace file]" % sys.argv[0])
+parser = ap.ArgumentParser(description="Curses interface for BLC2")
+parser.add_argument("-o", "--output", default="ola", action="store", help="Select the output")
+parser.add_argument("workspace", nargs='?', default=None, help="Workspace file to use")
+
+args = parser.parse_args()
+
+output = args.output.lower()
+if output == "none":
+ class NoOutput:
+ name = "None"
+
+ def set_values(self, values):
+ pass
+
+ @property
+ def ok(self):
+ return True
+
+ @property
+ def status(self):
+ return "Nothing's good"
+
+ def __init__(self):
+ pass
+
+ output = NoOutput()
+
+elif output == "dummy":
+ from .dummy import DummyOutput
+
+ output = DummyOutput()
+elif output == "ola":
+ from .ola import OLAOutput
+
+ output = OLAOutput()
+else:
+ raise ValueError("Unknown output \"%s\"" % output)
-Interface(sys.argv[1] if len(sys.argv) == 2 else None, OLAOutput()).main()
+Interface(args.workspace, output).main()
diff --git a/interface/input/tabcomp.py b/interface/input/tabcomp.py
index 4cce602..7479f97 100755
--- a/interface/input/tabcomp.py
+++ b/interface/input/tabcomp.py
@@ -152,7 +152,7 @@ class Input:
self.win.addstr(1, 1, ' '*(self._width-2))
self.win.addstr(2, 1, ' '*(self._width-2))
self.win.addstr(1, 1, l1)
- self.win.addstr(2, 1, l2, curses.A_ITALIC)
+ self.win.addstr(2, 1, l2, (curses.A_ITALIC if hasattr(curses, "A_ITALIC") else 0))
self.win.move(1, len(l1)+1)
self.win.refresh()
diff --git a/interface/interface.py b/interface/interface.py
index 832663e..6f68b2f 100644
--- a/interface/interface.py
+++ b/interface/interface.py
@@ -224,7 +224,7 @@ class Interface:
else:
continue
- for n, c in enumerate(f.channels, 1):
+ for n, c in enumerate(f.channels):
for s, e in cr[1]:
if (s <= n <= e) or (e == -1 and n >= s):
channels.append(c)
@@ -725,7 +725,7 @@ class Interface:
self.current_cv.chaser.advance_mode = mode
self.current_cv.set_chaser(self.current_cv.chaser, self.current_cv.selected)
- def base_copy(self, num, name=None):
+ def base_copy(self, name, num):
with self.w_lock:
## TODO: Implement this in BLC
if num not in self.w.functions:
@@ -786,8 +786,7 @@ class Interface:
("list audio", lambda: self.list_functions(AUDIO)),
("list joins", lambda: self.list_functions(JOIN)),
- ("copy $num", self.base_copy),
- ("copy $num $quoted_string", self.base_copy),
+ ("new scene $quoted_string from $num", self.base_copy),
("currentstatus", self.current_status),