From 135915ac960bbe2ab2054eb1399e4899f685ea83 Mon Sep 17 00:00:00 2001 From: enkore Date: Wed, 23 Oct 2013 21:08:49 +0200 Subject: [PATCH] Remove call_start_hooks and START_HOOKS #27 --- i3pystatus/core/__init__.py | 7 +------ i3pystatus/core/modules.py | 10 +--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/i3pystatus/core/__init__.py b/i3pystatus/core/__init__.py index caed78e..1aa493d 100644 --- a/i3pystatus/core/__init__.py +++ b/i3pystatus/core/__init__.py @@ -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) diff --git a/i3pystatus/core/modules.py b/i3pystatus/core/modules.py index c1f51b5..3e36f9c 100644 --- a/i3pystatus/core/modules.py +++ b/i3pystatus/core/modules.py @@ -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, -)