diff --git a/telegram-notify-daemon b/telegram-notify-daemon index 7876758..3e5dec2 100755 --- a/telegram-notify-daemon +++ b/telegram-notify-daemon @@ -149,7 +149,6 @@ class FilesChangedHandler(PatternMatchingEventHandler): event.src_path path/to/observed/file """ - global bot if event.event_type=='created': processFile(event.src_path) @@ -177,6 +176,7 @@ def exitGracefully(signum, frame): global shutdown shutdown = True + def setDefaults(): global configFile global defaults @@ -247,6 +247,7 @@ def initLogger(): logging.basicConfig(filename=logFile,level=logLevel,format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) + def checkPIDFile(): PIDFile = configParser.get('general', 'pid_file') try: @@ -310,6 +311,7 @@ def initBot(): observer.schedule(FilesChangedHandler(), path=spool_dir) observer.start() + initSignals() setDefaults() parseCmdLine()