cosmetic changes

This commit is contained in:
Rudi Grinberg 2012-07-13 12:01:14 -04:00 committed by Martin Konecny
parent 6b9cf85fc5
commit 54116fe5aa
2 changed files with 4 additions and 6 deletions

View File

@ -61,7 +61,7 @@ class AirtimeProcessEvent(ProcessEvent):
path = path[0:pos] + "/" path = path[0:pos] + "/"
list = self.api_client.list_all_watched_dirs() 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(): if path in list[u'dirs'].values():
self.logger.info("Requesting the airtime server to remove '%s'", path) self.logger.info("Requesting the airtime server to remove '%s'", path)
res = self.api_client.remove_watched_dir(path) res = self.api_client.remove_watched_dir(path)
@ -115,7 +115,7 @@ class AirtimeProcessEvent(ProcessEvent):
#event.name: filename #event.name: filename
#event.pathname: pathname (str): Concatenation of 'path' and 'name'. #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 # 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): def process_IN_CLOSE_WRITE(self, event):
if event.path in self.mount_file_dir: if event.path in self.mount_file_dir:
return return
@ -401,7 +401,7 @@ class AirtimeProcessEvent(ProcessEvent):
# handling those cases. We are manully calling handle_created_file # handling those cases. We are manully calling handle_created_file
# function. # function.
if os.path.exists(k): if os.path.exists(k):
# check if file is open # check if file is open
try: try:
command = "lsof " + k command = "lsof " + k
#f = os.popen(command) #f = os.popen(command)

View File

@ -7,7 +7,6 @@ from media.monitor.handler import ReportHandler
from media.monitor.events import NewFile, DeleteFile from media.monitor.events import NewFile, DeleteFile
from media.monitor.log import Loggable from media.monitor.log import Loggable
from media.monitor.exceptions import BadSongFile from media.monitor.exceptions import BadSongFile
import media.monitor.pure as mmp
from media.monitor.pure import LazyProperty from media.monitor.pure import LazyProperty
import api_clients.api_client as ac import api_clients.api_client as ac
@ -25,7 +24,7 @@ class RequestSync(threading.Thread,Loggable):
def run(self): def run(self):
# TODO : implement proper request sending # TODO : implement proper request sending
self.logger.info("launching request with %d items." % len(self.requests)) 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() self.watcher.flag_done()
class TimeoutWatcher(threading.Thread,Loggable): class TimeoutWatcher(threading.Thread,Loggable):
@ -104,7 +103,6 @@ class WatchSyncer(ReportHandler,Loggable):
self.push_request() self.push_request()
self.request_do() self.request_do()
def events_in_queue(self): def events_in_queue(self):
"""returns true if there are events in the queue that haven't been processed yet""" """returns true if there are events in the queue that haven't been processed yet"""
return len(self.__queue) > 0 return len(self.__queue) > 0