diff options
Diffstat (limited to 'interface/interface.py')
-rw-r--r-- | interface/interface.py | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/interface/interface.py b/interface/interface.py index c9f2a6e..b838b08 100644 --- a/interface/interface.py +++ b/interface/interface.py @@ -173,6 +173,26 @@ class Interface: def page_clear(self): self.pager.clear() + def help(self, name, commands, help_): + if name is None: + dname = "MODE HELP:" + else: + dname = name.upper() + " COMMAND:" + + todisp = [dname, ""] + if commands: + if name is None: + todisp.append("Available commands:") + else: + todisp.append("Available forms:") + todisp.extend(("- "+i for i in commands)) + todisp.append("") + + todisp.extend(help_.split('\n')) + + self.pager.display_many(todisp, split=True) + + def __init__(self, path): ## Have to do most of the actual initialization in the main method, as curses isn't ## ready yet. @@ -208,7 +228,17 @@ class Interface: ("page", self.page), ("clrpage", self.page_clear), ("quit", self.base_quit), - )) + ), { + None: "This is the base edit mode for editing functions.", + "edit": "Edit the specified function.", + "delete": "Delete the specified function.", + "new": "Create a new function of the given type.", + "save": "Save the workspace. The path is implicitly the one loaded from if not given.", + "list": "List available fixtures or functions.", + "page": "Page through the output window. Arrow keys, page up/down, home/end, and j/k can be used to scroll, q exits.", + "clrpage": "Clear the output window.", + "quit": "Exit BLC." + }, self.help) self.context_scene = Input.parse_context(( ("set $channel_range to $value", self.scene_set), @@ -220,4 +250,12 @@ class Interface: ("page", self.page), ("clrpage", self.page_clear), ("quit", self.scene_exit), - )) + ), { + None: "This mode is for editing scene primitives for fixed lighting.", + "set": "Set the given channel range to the given value (0 <= value <= 255).", + "reset": "Remove the given channel range from the scene", + "list": "List available fixtures or functions.", + "page": "Page through the output window. Arrow keys, page up/down, home/end, and j/k can be used to scroll, q exits.", + "clrpage": "Clear the output window.", + "quit": "Return to the previous mode." + }, self.help) |