Debian Codegraph @

envisage/examples/demo/MOTD/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 MOTD example application. """
12
13 # Enthought library imports.
14 from envisage.api import Application, CorePlugin
15
16
17 def main():
18 """Run the application."""
19 # Import here so that this script can be run from anywhere without
20 # having to install the packages.
21 from acme.motd.motd_plugin import MOTDPlugin
22 from acme.motd.software_quotes.software_quotes_plugin import (
23 SoftwareQuotesPlugin,
24 )
25
26 # Create an application containing the appropriate plugins.
27 application = Application(
28 id="acme.motd",
29 plugins=[CorePlugin(), MOTDPlugin(), SoftwareQuotesPlugin()],
30 )
31
32 # Run it!
33 return application.run()
34
35
36 if __name__ == "__main__":
37 # This context manager is added so that one can run this example from any
38 # directory without necessarily having installed the examples as packages.
39 from envisage.examples._demo import demo_path
40
41 with demo_path(__file__):
42 main()