mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-12-23 19:12:16 +03:00
plugin listener activated and some minor bug fixing
This commit is contained in:
parent
705565a416
commit
a9cc40fb2f
2 changed files with 6 additions and 14 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue