From 216a166437ef1902db297038b83c52baae9bf926 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Wed, 20 Jul 2011 16:15:58 +0200 Subject: [PATCH] CC-2571 : Media Monitor Bootstrap modifying files fix in bootstrap, fix functions to have parameters the same. --- .../airtimefilemonitor/airtimemediamonitorbootstrap.py | 6 +++--- .../media-monitor/airtimefilemonitor/airtimeprocessevent.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py b/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py index c72bbbd50..0a8d69d69 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py @@ -125,11 +125,11 @@ class AirtimeMediaMonitorBootstrap(): for file_path in new_files_set: file_path = "%s%s" % (dir, file_path) if os.path.exists(file_path): - organized_filepath = self.pe.handle_created_file(False, os.path.basename(file_path), file_path) + organized_filepath = self.pe.handle_created_file(False, file_path, os.path.basename(file_path)) if organized_filepath is not None: - self.pe.handle_created_file(False, os.path.basename(organized_filepath), organized_filepath) + self.pe.handle_created_file(False, organized_filepath, os.path.basename(organized_filepath)) for file_path in modified_files_set: file_path = "%s%s" % (dir, file_path) if os.path.exists(file_path): - self.pe.handle_modified_file(False, os.path.basename(file_path), file_path) + self.pe.handle_modified_file(False, file_path, os.path.basename(file_path)) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py index c14a8ee5b..a9279f6b5 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py @@ -46,9 +46,9 @@ class AirtimeProcessEvent(ProcessEvent): #event.name: filename #event.pathname: pathname (str): Concatenation of 'path' and 'name'. def process_IN_CREATE(self, event): - self.handle_created_file(event.dir, event.name, event.pathname) + self.handle_created_file(event.dir, event.pathname, event.name) - def handle_created_file(self, dir, name, pathname): + def handle_created_file(self, dir, pathname, name): if not dir: self.logger.debug("PROCESS_IN_CREATE: %s, name: %s, pathname: %s ", dir, name, pathname) #event is because of a created file @@ -84,7 +84,7 @@ class AirtimeProcessEvent(ProcessEvent): self.handle_modified_file(event.dir, event.pathname, event.name) def handle_modified_file(self, dir, pathname, name): - if not dir and self.mmc.is_parent_directory(pathname, self.config.organize_directory): + if not dir and not self.mmc.is_parent_directory(pathname, self.config.organize_directory): self.logger.info("Modified: %s", pathname) if self.mmc.is_audio_file(name): self.file_events.append({'filepath': pathname, 'mode': self.config.MODE_MODIFY})