41 |
modules = {} |
modules = {} |
42 |
module_events = {} |
module_events = {} |
43 |
|
|
44 |
def __init__(self, d = None): |
def __init__(self, config, d = None): |
45 |
# FIXME: Do some work on the config defaults |
|
46 |
self.config = config.Config() |
self.config = config |
47 |
|
|
48 |
if d: |
if d: |
49 |
self.display = display.Display(d) |
self.display = display.Display(d) |
109 |
|
|
110 |
|
|
111 |
def handle_event(self, event): |
def handle_event(self, event): |
112 |
|
#XXX: What events should Ringmaster give a crap about? |
113 |
pass |
pass |
114 |
|
|
115 |
|
|
116 |
def import_modules(self): |
def import_modules(self): |
117 |
"""Load all modules in config or startup dir or wherever.... |
"""Load all modules in config""" |
118 |
""" |
print "Importing modules" |
|
|
|
|
print "importing modules" |
|
119 |
|
|
120 |
|
|
121 |
def _import_name(self, modulename, name): |
def _import_name(self, modulename, name): |
146 |
Module = self._import_name("Circus" + module_name + "." + |
Module = self._import_name("Circus" + module_name + "." + |
147 |
string.lower(module_name), "MyModule") |
string.lower(module_name), "MyModule") |
148 |
|
|
149 |
|
|
150 |
|
if not Module: |
151 |
|
print "AH FUCK" |
152 |
# Add it to our modules |
# Add it to our modules |
153 |
self.modules.setdefault(module_name, Module()) |
self.modules.setdefault(module_name, Module()) |
154 |
|
|