Changeset 36:f79362793664 for src/mlx/mlx.py
- Timestamp:
- 03/04/12 06:27:05 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/mlx.py
r29 r36 2 2 3 3 from .gui.gui import GUI 4 from .gui.common import * 4 5 from config import Config 5 6 6 7 import os 8 import sys 7 9 8 def main(iconDirectory): 10 #-------------------------------------------------------------------------------------- 11 12 class StdIOHandler(object): 13 """Handler for the standard I/O messages.""" 14 def __init__(self, gui): 15 """Construct the handler.""" 16 self._gui = gui 17 18 def write(self, text): 19 """Write the given text into the log.""" 20 self._gui.writeStdIO(text) 21 22 #-------------------------------------------------------------------------------------- 23 24 def main(): 9 25 """The main operation of the program.""" 10 gui = GUI()26 programDirectory = os.path.dirname(sys.argv[0]) 11 27 12 gui.build(iconDirectory) 28 config = Config() 29 gui = GUI(programDirectory, config) 30 31 sys.stdout = StdIOHandler(gui) 32 sys.stderr = StdIOHandler(gui) 33 34 gui.build(programDirectory) 13 35 14 36 gui.run() 15 37 38 #-------------------------------------------------------------------------------------- 39 16 40 if __name__ == "__main__": 17 main(os.path.dirname(__file__)) 18 19 41 main()
Note:
See TracChangeset
for help on using the changeset viewer.