Remove call_start_hooks and START_HOOKS #27

This commit is contained in:
enkore 2013-10-23 21:08:49 +02:00
parent 2895aa44cf
commit 135915ac96
2 changed files with 2 additions and 15 deletions

View File

@ -5,7 +5,7 @@ from threading import Thread
from i3pystatus.core.imputil import ClassFinder
from i3pystatus.core import io, util
from i3pystatus.core.modules import Module, START_HOOKS
from i3pystatus.core.modules import Module
class CommandEndpoint:
@ -65,13 +65,8 @@ class Status:
else:
return None
def call_start_hooks(self):
for hook in START_HOOKS:
hook()
def run(self):
self.command_endpoint.start()
self.call_start_hooks()
for j in io.JSONIO(self.io).read():
for module in self.modules:
module.inject(j)

View File

@ -52,11 +52,7 @@ class IntervalModule(Module):
am = Manager(self.interval)
am.append(self)
IntervalModule.managers[self.interval] = am
@classmethod
def _start(cls):
for manager in cls.managers.values():
manager.start()
am.start()
def __call__(self):
self.run()
@ -66,7 +62,3 @@ class IntervalModule(Module):
Do not rely on this being called from the same thread at all times.
If you need to always have the same thread context, subclass AsyncModule."""
START_HOOKS = (
IntervalModule._start,
)