24 |
import os |
import os |
25 |
|
|
26 |
# TODO: options parsing |
# TODO: options parsing |
27 |
usage = """circus [options] |
usage = """Usage: circus [options] |
28 |
|
|
29 |
Available options: |
Options: |
30 |
-v print version information and exit""" |
-h, --help display this help message |
31 |
|
-v, --version print version information and exit |
32 |
|
""" |
33 |
|
|
34 |
|
|
35 |
|
############################################################################### |
36 |
# Put this down here. No need to import if were just printing usage |
# Put this down here. No need to import if were just printing usage |
37 |
from circus import * |
from circus import * |
38 |
|
|
39 |
master = circus.Ringmaster() |
config = config.Config() |
40 |
|
# XXX: these have been moved to Config module |
41 |
|
config.circus_home = os.environ['CIRCUS_HOME'] |
42 |
|
# TODO: add support for multiple paths |
43 |
|
config.set_module_path(os.environ['CIRCUS_MODULES']) |
44 |
|
|
45 |
master.config.circus_home = os.environ['CIRCUS_HOME'] |
# FIXME: okay, were calling Ringmaster() before we set CIRCUS_HOME....isnt |
46 |
|
# there something wrong with this logic? Wont the directory this file is in |
47 |
|
# always be CIRCUS_HOME? What if CIRCUS_HOME points somewhere else? How |
48 |
|
# would that change things? .... |
49 |
|
master = circus.Ringmaster(config) |
50 |
|
|
51 |
# TODO: add support for multiple paths |
# Load modules listed in config |
52 |
master.config.set_module_path(os.environ['CIRCUS_MODULES']) |
master.import_modules() |
53 |
|
|
54 |
master.load_module("Keybindings") |
master.load_module("Keybindings") |
55 |
master.load_module("Example") |
master.load_module("Example") |
56 |
|
master.unload_module("Example") |
57 |
|
master.config.dump_config() |
58 |
# Enter the main loop |
# Enter the main loop |
59 |
master.loop() |
master.loop() |
60 |
|
|