blc2 - Python library and frontend for running theatrical lighting and SFX. Written for the English 2041F fall 2019 theatre production of "The Cenci".

git clone https://benconnors.ca/git-repos/blc2

Log | Files | Refs

__main__.py (1041B) - raw


      1 #!/usr/bin/env python3
      2 
      3 import argparse as ap
      4 import datetime as dt
      5 import os
      6 import sys
      7 
      8 from .interface import Interface
      9 
     10 parser = ap.ArgumentParser(description="Curses interface for BLC2")
     11 parser.add_argument("-o", "--output", default="ola", action="store", help="Select the output")
     12 parser.add_argument("workspace", nargs='?', default=None, help="Workspace file to use")
     13 
     14 args = parser.parse_args()
     15 
     16 output = args.output.lower()
     17 if output == "none":
     18     class NoOutput:
     19         name = "None"
     20 
     21         def set_values(self, values):
     22             pass 
     23 
     24         @property
     25         def ok(self):
     26             return True 
     27 
     28         @property
     29         def status(self):
     30             return "Nothing's good"
     31 
     32         def __init__(self):
     33             pass
     34 
     35     output = NoOutput()
     36 
     37 elif output == "dummy":
     38     from .dummy import DummyOutput
     39 
     40     output = DummyOutput()
     41 elif output == "ola":
     42     from .ola import OLAOutput
     43 
     44     output = OLAOutput()
     45 else:
     46     raise ValueError("Unknown output \"%s\"" % output)
     47 
     48 Interface(args.workspace, output).main()