many small fixes, typo and newlines... housekeeping!

This commit is contained in:
Johannes Findeisen 2013-08-18 23:45:12 +02:00
commit 4193058957
4 changed files with 11 additions and 6 deletions

View file

@ -3,6 +3,7 @@ from subprocess import Popen
from subprocess import CalledProcessError from subprocess import CalledProcessError
from datetime import datetime as dt from datetime import datetime as dt
#TODO: Move this to shell.py service file. this definitely is shell execution. (hanez)
class Command: class Command:
def __init__(self, command, log): def __init__(self, command, log):

View file

@ -39,10 +39,10 @@ class Job:
self.jobThreshold += 1 self.jobThreshold += 1
if self.jobThreshold >= serviceThreshold: if self.jobThreshold >= serviceThreshold:
self.log.d("ARGGHHH!!") self.log.d("Threshold reached!")
self.handle_alarm(self.jobThreshold-serviceThreshold) self.handle_alarm(self.jobThreshold - serviceThreshold)
def handle_alarm(self, threholdOffset): def handle_alarm(self, thresholdOffset):
pass pass
def handle_call(self): def handle_call(self):

View file

@ -1,6 +1,13 @@
from ..core import logger from ..core import logger
from ..core.daemon import Daemon from ..core.daemon import Daemon
"""
TODO: Think about, that daemonizing this software is not our goal but when we want to that, this needs a rewrite and
should maybe move over to the daemon frontend. daemon.py will remain the the base for this and should stay in lib/core .
Since a daemon it normally not a frontend we should think about how to handle this. When daemonizing a real frontend
like "Lish" will make no sense but a frontend like "https" or "xmpp" could be useful anyway...
"""
class LinspectorDaemon(Daemon): class LinspectorDaemon(Daemon):
def run(self): def run(self):

View file

@ -16,7 +16,6 @@ class Service(object):
elif self.needs_arguments(): elif self.needs_arguments():
raise Exception("Error: needs arguments but none provided!") raise Exception("Error: needs arguments but none provided!")
self._parser = [] self._parser = []
if KEY_PARSER in kwargs: if KEY_PARSER in kwargs:
self.add_parser(kwargs[KEY_PARSER]) self.add_parser(kwargs[KEY_PARSER])
@ -36,9 +35,7 @@ class Service(object):
self._periods = [] self._periods = []
if KEY_PERIODS in kwargs: if KEY_PERIODS in kwargs:
self.add_periods(kwargs[KEY_PERIODS]) self.add_periods(kwargs[KEY_PERIODS])
def add_arguments(self, args): def add_arguments(self, args):
for key, val in args.items(): for key, val in args.items():
self._args[key] = val self._args[key] = val