From a7a5b297ac4d76f5a1c394f0cfcc19f0eeb44dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Thu, 4 Aug 2016 18:11:00 +0300 Subject: [PATCH] minor bug fix about loading plugin --- opt/ahenk/base/plugin/file_handler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/opt/ahenk/base/plugin/file_handler.py b/opt/ahenk/base/plugin/file_handler.py index a29837f..5d5a1ba 100644 --- a/opt/ahenk/base/plugin/file_handler.py +++ b/opt/ahenk/base/plugin/file_handler.py @@ -14,10 +14,8 @@ class FileEventHandler(FileSystemEventHandler): def process(self, event): 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 + 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) @@ -27,5 +25,6 @@ class FileEventHandler(FileSystemEventHandler): os.kill(int(System.Ahenk.get_pid_number()), signal.SIGALRM) def on_any_event(self, event): + if event.is_directory: self.process(event)