File: run.py

package info (click to toggle)
python-envisagecore 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,096 kB
  • ctags: 1,063
  • sloc: python: 4,115; makefile: 7; sh: 5
file content (43 lines) | stat: -rw-r--r-- 1,018 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
""" Run the MOTD example application. """


# Standard library imports.
import logging

# Enthought library imports.
from enthought.envisage.api import Application


# Enthought plugins.
from enthought.envisage.core_plugin import CorePlugin

# Example plugins.
from acme.motd.motd_plugin import MOTDPlugin
from acme.motd.software_quotes.software_quotes_plugin import (
    SoftwareQuotesPlugin
)


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


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

    # Create an application containing the appropriate plugins.
    application = Application(
        id      = 'acme.motd',
        plugins = [CorePlugin(), MOTDPlugin(), SoftwareQuotesPlugin()]
    )

    # Run it!
    return application.run()


if __name__ == '__main__':
    main()

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