mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 10:52:17 +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:
|
try:
|
||||||
while registration.is_registered() is False:
|
while registration.is_registered() is False:
|
||||||
# while Scope.getInstance().getRegistration().is_registered() is False:
|
|
||||||
max_attemp_number -= 1
|
max_attemp_number -= 1
|
||||||
logger.debug('[AhenkDeamon] Ahenk is not registered. Attempting for registration')
|
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()
|
registration.registration_request()
|
||||||
# Scope.getInstance().getRegistration().registration_request()
|
|
||||||
if max_attemp_number < 0:
|
if max_attemp_number < 0:
|
||||||
logger.warning('[AhenkDeamon] Number of Attempting for registration is over')
|
logger.warning('[AhenkDeamon] Number of Attempting for registration is over')
|
||||||
self.registration_failed()
|
self.registration_failed()
|
||||||
|
|
|
@ -2,13 +2,13 @@ import os
|
||||||
import signal
|
import signal
|
||||||
import time
|
import time
|
||||||
|
|
||||||
# from watchdog.events import FileSystemEventHandler
|
from watchdog.events import FileSystemEventHandler
|
||||||
# from watchdog.observers import Observer
|
from watchdog.observers import Observer
|
||||||
|
|
||||||
from base.command.commander import Commander
|
from base.command.commander import Commander
|
||||||
from base.system.system import System
|
from base.system.system import System
|
||||||
|
|
||||||
"""
|
|
||||||
class FileEventHandler(FileSystemEventHandler):
|
class FileEventHandler(FileSystemEventHandler):
|
||||||
def __init__(self, plugin_path):
|
def __init__(self, plugin_path):
|
||||||
self.path = plugin_path
|
self.path = plugin_path
|
||||||
|
@ -31,15 +31,12 @@ class FileEventHandler(FileSystemEventHandler):
|
||||||
if event.is_directory:
|
if event.is_directory:
|
||||||
self.process(event)
|
self.process(event)
|
||||||
|
|
||||||
def on_modified(self,event):
|
# def on_modified(self, event):
|
||||||
print("MODIFIED-"+str(event.src_path))
|
# print("MODIFIED-" + str(event.src_path))
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
class PluginInstallListener:
|
class PluginInstallListener:
|
||||||
|
|
||||||
def listen(self, path):
|
def listen(self, path):
|
||||||
pass
|
|
||||||
"""
|
|
||||||
observer = Observer()
|
observer = Observer()
|
||||||
event_handler = FileEventHandler(path)
|
event_handler = FileEventHandler(path)
|
||||||
observer.schedule(event_handler, path, recursive=False)
|
observer.schedule(event_handler, path, recursive=False)
|
||||||
|
@ -50,4 +47,3 @@ class PluginInstallListener:
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
observer.stop()
|
observer.stop()
|
||||||
observer.join()
|
observer.join()
|
||||||
"""
|
|
||||||
|
|
Loading…
Reference in a new issue