From a4c322efac7b6b3ee90a3fec4faee706bd67b5ad Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 13 Jul 2012 12:01:14 -0400 Subject: [PATCH] cosmetic changes --- .../media-monitor/airtimefilemonitor/airtimeprocessevent.py | 6 +++--- python_apps/media-monitor2/media/monitor/watchersyncer.py | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py index 5b7e21e7e..90b8a0151 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py @@ -61,7 +61,7 @@ class AirtimeProcessEvent(ProcessEvent): path = path[0:pos] + "/" list = self.api_client.list_all_watched_dirs() - # case where the dir that is being watched is moved to somewhere + # case where the dir that is being watched is moved to somewhere if path in list[u'dirs'].values(): self.logger.info("Requesting the airtime server to remove '%s'", path) res = self.api_client.remove_watched_dir(path) @@ -115,7 +115,7 @@ class AirtimeProcessEvent(ProcessEvent): #event.name: filename #event.pathname: pathname (str): Concatenation of 'path' and 'name'. # we used to use IN_CREATE event, but the IN_CREATE event gets fired before the - # copy was done. Hence, IN_CLOSE_WRITE is the correct one to handle. + # copy was done. Hence, IN_CLOSE_WRITE is the correct one to handle. def process_IN_CLOSE_WRITE(self, event): if event.path in self.mount_file_dir: return @@ -401,7 +401,7 @@ class AirtimeProcessEvent(ProcessEvent): # handling those cases. We are manully calling handle_created_file # function. if os.path.exists(k): - # check if file is open + # check if file is open try: command = "lsof " + k #f = os.popen(command) diff --git a/python_apps/media-monitor2/media/monitor/watchersyncer.py b/python_apps/media-monitor2/media/monitor/watchersyncer.py index e2dac9f7c..97c1c7800 100644 --- a/python_apps/media-monitor2/media/monitor/watchersyncer.py +++ b/python_apps/media-monitor2/media/monitor/watchersyncer.py @@ -7,7 +7,6 @@ from media.monitor.handler import ReportHandler from media.monitor.events import NewFile, DeleteFile from media.monitor.log import Loggable from media.monitor.exceptions import BadSongFile -import media.monitor.pure as mmp from media.monitor.pure import LazyProperty import api_clients.api_client as ac @@ -25,7 +24,7 @@ class RequestSync(threading.Thread,Loggable): def run(self): # TODO : implement proper request sending self.logger.info("launching request with %d items." % len(self.requests)) - # self.apiclient.update_media_metadata(self + #self.apiclient.update_media_metadata( self.watcher.flag_done() class TimeoutWatcher(threading.Thread,Loggable): @@ -104,7 +103,6 @@ class WatchSyncer(ReportHandler,Loggable): self.push_request() self.request_do() - def events_in_queue(self): """returns true if there are events in the queue that haven't been processed yet""" return len(self.__queue) > 0