File: run.py

package info (click to toggle)
python-envisageplugins 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,600 kB
  • sloc: python: 6,968; sh: 11; makefile: 8; lisp: 1
file content (44 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
""" Run the Lorenz example application. """


# Standard library imports.
import logging

# Enthought plugins.
from enthought.envisage.core_plugin import CorePlugin
from enthought.envisage.ui.workbench.workbench_plugin import WorkbenchPlugin

# Example imports.
from acme.lorenz.lorenz_application import LorenzApplication
from acme.lorenz.lorenz_plugin import LorenzPlugin
from acme.lorenz.lorenz_ui_plugin import LorenzUIPlugin


# Do whatever you want to do with log messages! Here we create a log file.
logger = logging.getLogger()
#logger.addHandler(logging.StreamHandler(file('lorenz.log', 'w')))
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)


def main():
    """ Run the application. """

    # Create an application with the specified plugins.
    lorenz_application = LorenzApplication(
        plugins=[
            CorePlugin(), WorkbenchPlugin(), LorenzPlugin(), LorenzUIPlugin()
        ]
    )

    # Run it! This starts the application, starts the GUI event loop, and when
    # that terminates, stops the application.
    lorenz_application.run()

    return


if __name__ == '__main__':
    main()

#### EOF ######################################################################