1. pyro.gui.gui
This is the base class for a gui.
In File: pyrobot/gui/init.py
Subclass of: pyro.gui.Drawable (see PyroDocGuiDrawable) in pyrobot/gui/drawable.py
Depends on:
-
pyro.gui.drawable (see PyroDocGuiDrawable)
-
pyro.gui.renderer.tty
-
pyro.gui.renderer.streams
-
pyro.system.version
-
pyro.system.help
- pyro.gui.gui
1.1. Constructor(name = 'abstract gui' options = {}, engine = 0)
Child classes should do initialization pertaining to the creation of the GUI in the constructor.
Arguments:
-
name: String
-
options: Dictionary
-
engine: ?
1.2. Internal Functions
1.2.1. _draw(options, renderer)
If the gui need draw something itself it should go here.
Doesn't really do anything
1.3. External Functions
1.3.1. init()
No docstring
Looks like it's made to be overridden in children; in this class, it's just pass
1.3.2. run()
Child classes should do the beef of what they do right here.
1.3.3. processCommand(retval)
No docstring
Arguments:
-
retval: This should be one of the following commands:
-
'run': calls self.enging.pleaseRun()
-
'help': calls help()
-
'reload': calls self.engine.reset()
-
'robot': loadRobot()
-
'brain': loadBrain()
-
'stop': call self.engine.pleaseStop()
-
'quit', 'exit', 'bye': Looks like it's supposed to quit, but currently just returns 1
-
Any string with the initial character '%': pass the rest of the string to os.system()
-
'edit': open the brain file in emacs
1.3.4. redraw()
No docstring
=== makeMenu(name, commands):
Could bind a key right here 1, 2, ^3...
Arguments:
-
name: string?
-
commands: list?
This is an abstract function, but it looks like it might take a menu name and a list of menu commands (or maybe a dictionary with functions linked to the command names).
1.3.5. fileloaddialog(type, skel)
Could read a line from user
Arguments:
-
type: ?
-
skel: ?
No idea on how this one's supposed to work
1.3.6. cleanup()
No docstring
Shuts down the engine and exits
1.3.7. stepEngine()
No docstring
Calls self.engine.pleaseStep()
1.3.8. runEngine()
No docstring
Calls self.engine.pleaseRun()
1.3.9. stopEngine()
No docstring
Calls self.engine.pleaseStop()
1.3.10. stepForward()
No docstring
calls self.engine.robot.step('F')
1.3.11. stepBack()
No docstring
calls self.engine.robot.step('B')
1.3.12. stepLeft()
No docstring
calls self.engine.robot.step('L')
1.3.13. stepRight()
No docstring
calls self.engine.robot.step('R')
1.3.14. resetEngine()
No docstring
calls self.engine.reset()
1.3.15. loadBrain()
No docstring
Creates a fileloaddialog, and asks the engine to load the resulting .py file.
1.3.16. loadPlot()
No Docstring
Creates a fileloaddialog, and asks the engine to load the resulting .py file.
1.3.17. freeBrain()
No Docstring
calls self.engine.freeBrain()
1.3.18. loadSim()
Creates a fileloaddialog, and asks the os to run the resulting file in the background
=== loadRobot() ===
No Docstring
Creates a fileloaddialog, and asks the engine to load the resulting .py file.
1.3.19. freeRobot()
No Docstring
calls self.engine.freeRobot()
1.3.20. INThandler(signum, frame)
No Docstring
Arguments:
-
signum: ?
-
frame: ?
Simply calls self.cleanup()
1.3.21. inform(message)
No Docstring
Arguments:
-
message: a string; if it is longer than 50 characters, it will be truncated
Calls self.status.set, passing in the first 50 characters of message.
