Aaand some code butchering I forgot earlier.

This commit is contained in:
enkore 2013-03-05 17:27:12 +01:00
parent dcc9f3c6bb
commit 8ebca17e79

View File

@ -2,9 +2,9 @@
import sys import sys
from .core import io from .core import util, io
from .core.util import *
from .core.modules import * from .core.modules import *
from .core.settings import SettingsBase
__all__ = [ __all__ = [
"SettingsBase", "SettingsBase",
@ -15,11 +15,11 @@ __all__ = [
class Status: class Status:
def __init__(self, standalone=False, interval=1, input_stream=sys.stdin): def __init__(self, standalone=False, interval=1, input_stream=sys.stdin):
if standalone: if standalone:
self.io = core.io.StandaloneIO(interval) self.io = io.StandaloneIO(interval)
else: else:
self.io = core.io.IOHandler(input_stream) self.io = io.IOHandler(input_stream)
self.modules = ModuleList(self, Module) self.modules = util.ModuleList(self, Module)
def register(self, module, *args, **kwargs): def register(self, module, *args, **kwargs):
"""Register a new module.""" """Register a new module."""
@ -28,7 +28,7 @@ class Status:
self.modules.append(module, *args, **kwargs) self.modules.append(module, *args, **kwargs)
def run(self): def run(self):
for j in core.io.JSONIO(self.io).read(): for j in io.JSONIO(self.io).read():
for module in self.modules: for module in self.modules:
module.inject(j) module.inject(j)
I3statusHandler = Status I3statusHandler = Status