Ignore:
Timestamp:
03/04/12 06:27:05 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Update seems to work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/mlx.py

    r29 r36  
    22
    33from .gui.gui import GUI
    4 from .gui.common import *
     4
     5from config import Config
    56
    67import os
     8import sys
    79
    8 def main(iconDirectory):
     10#--------------------------------------------------------------------------------------
     11
     12class 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
     24def main():
    925    """The main operation of the program."""
    10     gui = GUI()
     26    programDirectory = os.path.dirname(sys.argv[0])
    1127
    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)
    1335
    1436    gui.run()
    1537
     38#--------------------------------------------------------------------------------------
     39
    1640if __name__ == "__main__":
    17     main(os.path.dirname(__file__))
    18 
    19 
     41    main()
Note: See TracChangeset for help on using the changeset viewer.