From 974858c8f50bdad9122d66109891d81602cd222d Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 16 Aug 2012 14:34:40 -0400 Subject: [PATCH] MM2: fixed bug where index file wans't being created --- python_apps/media-monitor2/media/monitor/listeners.py | 4 ++-- python_apps/media-monitor2/mm2.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python_apps/media-monitor2/media/monitor/listeners.py b/python_apps/media-monitor2/media/monitor/listeners.py index 48a4cd5bf..6858527b9 100644 --- a/python_apps/media-monitor2/media/monitor/listeners.py +++ b/python_apps/media-monitor2/media/monitor/listeners.py @@ -133,8 +133,8 @@ class StoreWatchListener(BaseListener, Loggable, pyinotify.ProcessEvent): @IncludeOnly(mmp.supported_extensions) def process_delete(self, event): evt = None - if event.dir: evt = DeleteDir(event) - else: evt = DeleteFile(event) + if event.dir : evt = DeleteDir(event) + else : evt = DeleteFile(event) dispatcher.send(signal=self.signal, sender=self, event=evt) return evt diff --git a/python_apps/media-monitor2/mm2.py b/python_apps/media-monitor2/mm2.py index 849d7ae6b..752076da2 100644 --- a/python_apps/media-monitor2/mm2.py +++ b/python_apps/media-monitor2/mm2.py @@ -57,7 +57,7 @@ def main(global_config, api_client_config, log_config, if not os.path.exists(config['index_path']): log.info("Attempting to create index file:...") try: - with open(config['index_path']) as f: f.write(" ") + with open(config['index_path'], 'w') as f: f.write(" ") except Exception as e: log.info("Failed to create index file with exception: %s" % str(e)) else: