From a9cc40fb2fe64084b20ff3e94638c4eed9d0dbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Mon, 25 Jul 2016 18:32:28 +0300 Subject: [PATCH] plugin listener activated and some minor bug fixing --- opt/ahenk/ahenkd.py | 4 ---- opt/ahenk/base/plugin/plugin_install_listener.py | 16 ++++++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/opt/ahenk/ahenkd.py b/opt/ahenk/ahenkd.py index 44b825f..3456899 100755 --- a/opt/ahenk/ahenkd.py +++ b/opt/ahenk/ahenkd.py @@ -124,13 +124,9 @@ class AhenkDeamon(BaseDaemon): try: while registration.is_registered() is False: - # while Scope.getInstance().getRegistration().is_registered() is False: max_attemp_number -= 1 logger.debug('[AhenkDeamon] Ahenk is not registered. Attempting for registration') - # TODO 'Could not reach Registration response from Lider. Be sure Lider is running and it is connected to XMPP server!' - registration.registration_request() - # Scope.getInstance().getRegistration().registration_request() if max_attemp_number < 0: logger.warning('[AhenkDeamon] Number of Attempting for registration is over') self.registration_failed() diff --git a/opt/ahenk/base/plugin/plugin_install_listener.py b/opt/ahenk/base/plugin/plugin_install_listener.py index a1c1c5a..47cc387 100644 --- a/opt/ahenk/base/plugin/plugin_install_listener.py +++ b/opt/ahenk/base/plugin/plugin_install_listener.py @@ -2,13 +2,13 @@ import os import signal import time -# from watchdog.events import FileSystemEventHandler -# from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler +from watchdog.observers import Observer from base.command.commander import Commander from base.system.system import System -""" + class FileEventHandler(FileSystemEventHandler): def __init__(self, plugin_path): self.path = plugin_path @@ -31,15 +31,12 @@ class FileEventHandler(FileSystemEventHandler): if event.is_directory: self.process(event) - def on_modified(self,event): - print("MODIFIED-"+str(event.src_path)) + # def on_modified(self, event): + # print("MODIFIED-" + str(event.src_path)) + -""" class PluginInstallListener: - def listen(self, path): - pass - """ observer = Observer() event_handler = FileEventHandler(path) observer.schedule(event_handler, path, recursive=False) @@ -50,4 +47,3 @@ class PluginInstallListener: except KeyboardInterrupt: observer.stop() observer.join() - """