Debian Codegraph @

examples/legacy/workbench/AcmeLab/run.py

raw
1 # (C) Copyright 2007-2025 Enthought, Inc., Austin, TX
2 # All rights reserved.
3 #
4 # This software is provided without warranty under the terms of the BSD
5 # license included in LICENSE.txt and may be redistributed only under
6 # the conditions described in the aforementioned license. The license
7 # is also available online at http://www.enthought.com/licenses/BSD.txt
8 #
9 # Thanks for using Enthought open source!
10
11 """ Run the AcmeLab example application. """
12
13
14 # Standard library imports.
15 import logging
16
17 # Example imports.
18 from acme.acmelab.api import Acmelab
19
20 # Example plugins.
21 from acme.workbench.acme_workbench_plugin import AcmeWorkbenchPlugin
22
23 # Enthought plugins.
24 from envisage.api import CorePlugin
25 from envisage.ui.workbench.workbench_plugin import WorkbenchPlugin
26
27 # Do whatever you want to do with log messages! Here we create a log file.
28 logger = logging.getLogger()
29 # logger.addHandler(logging.StreamHandler(file('acmelab.log', 'w')))
30 logger.addHandler(logging.StreamHandler())
31 logger.setLevel(logging.DEBUG)
32
33
34 def main():
35 """Run the application."""
36
37 # Create an application with the specified plugins.
38 acmelab = Acmelab(
39 plugins=[CorePlugin(), WorkbenchPlugin(), AcmeWorkbenchPlugin()]
40 )
41
42 # Run it! This starts the application, starts the GUI event loop, and when
43 # that terminates, stops the application.
44 acmelab.run()
45
46 return
47
48
49 if __name__ == "__main__":
50 main()