From e524bf3797f2378199682032e2c8172eac160061 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Sat, 12 Oct 2013 02:34:39 +0200 Subject: [PATCH] deleted the abstracted daemon and moved class over to daemon.py --- linspector/core/daemon.py | 21 ++++++++++++++ linspector/core/linspector_daemon.py | 42 ---------------------------- 2 files changed, 21 insertions(+), 42 deletions(-) delete mode 100644 linspector/core/linspector_daemon.py diff --git a/linspector/core/daemon.py b/linspector/core/daemon.py index c80bb2d..799b48f 100644 --- a/linspector/core/daemon.py +++ b/linspector/core/daemon.py @@ -24,6 +24,27 @@ import time import atexit from signal import SIGTERM +""" +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 linspector/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): + def run(self): + while True: + try: + a = 2 + #logger.writeLogToFile(_logfile, "Running!") + print "running!" + except Exception as err: + #logger.writeLogToFile(_logfile, str(err)) + print "failed" + sys.exit(1) + time.sleep(1) + class Daemon: """ diff --git a/linspector/core/linspector_daemon.py b/linspector/core/linspector_daemon.py deleted file mode 100644 index ee9d940..0000000 --- a/linspector/core/linspector_daemon.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -Copyright (c) 2011-2013 "Johannes Findeisen and Rafael Timmerberg" - -This file is part of Linspector (http://linspector.org). - -Linspector is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . -""" - -from ..core import logger -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 linspector/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): - def run(self): - while True: - try: - a = 2 - logger.writeLogToFile(_logfile, "Running!") - print "running!" - except Exception as err: - #logger.writeLogToFile(_logfile, str(err)) - print "failed" - sys.exit(1) - time.sleep(1) \ No newline at end of file