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 45 46 47 48 49 50 51
|
""" Run the AcmeLab example application. """
# Standard library imports.
import logging
# Example imports.
from acme.acmelab.api import Acmelab
# Enthought plugins.
from enthought.envisage.core_plugin import CorePlugin
from enthought.envisage.developer.developer_plugin import DeveloperPlugin
from enthought.envisage.developer.ui.developer_ui_plugin import DeveloperUIPlugin
from enthought.envisage.ui.workbench.workbench_plugin import WorkbenchPlugin
# Example plugins.
from acme.workbench.acme_workbench_plugin import AcmeWorkbenchPlugin
# Do whatever you want to do with log messages! Here we create a log file.
logger = logging.getLogger()
#logger.addHandler(logging.StreamHandler(file('acmelab.log', 'w')))
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
def main():
""" Run the application. """
# Create an application with the specified plugins.
acmelab = Acmelab(
plugins=[
CorePlugin(),
WorkbenchPlugin(),
AcmeWorkbenchPlugin(),
DeveloperPlugin(),
DeveloperUIPlugin()
]
)
# Run it! This starts the application, starts the GUI event loop, and when
# that terminates, stops the application.
acmelab.run()
return
if __name__ == '__main__':
main()
#### EOF ######################################################################
|