modified bug fixed and remove added

This commit is contained in:
Volkan Şahin 2016-07-26 15:09:02 +03:00
parent a9cc40fb2f
commit 4548253fed

View file

@ -14,26 +14,24 @@ class FileEventHandler(FileSystemEventHandler):
self.path = plugin_path
def process(self, event):
if event.event_type == 'created':
result = Commander().set_event([None, 'load', '-p', event.src_path.replace(self.path, '')])
if result is True:
if System.Ahenk.is_running() is True:
if event.src_path != self.path[:-1]:
if event.event_type in ('created', 'modified', 'moved'):
plu_path = event.src_path
if event.event_type == 'moved':
plu_path = event.dest_path
result = Commander().set_event([None, 'load', '-p', plu_path.replace(self.path, '')])
if result is True and System.Ahenk.is_running() is True:
os.kill(int(System.Ahenk.get_pid_number()), signal.SIGALRM)
elif event.event_type == 'deleted':
result = Commander().set_event([None, 'remove', '-p', event.src_path.replace(self.path, '')])
if result is True and System.Ahenk.is_running() is True:
os.kill(int(System.Ahenk.get_pid_number()), signal.SIGALRM)
elif event.event_type == 'deleted':
# TODO
print('plugin removed')
def on_created(self, event):
def on_any_event(self, event):
if event.is_directory:
self.process(event)
def on_deleted(self, event):
if event.is_directory:
self.process(event)
# def on_modified(self, event):
# print("MODIFIED-" + str(event.src_path))
class PluginInstallListener:
def listen(self, path):