cc-4105: removed useless function. reformatted comments
This commit is contained in:
parent
a9819f54d5
commit
517730e012
python_apps/media-monitor2/media/monitor
|
@ -11,9 +11,9 @@ import media.monitor.pure as mmp
|
|||
|
||||
class Manager(Loggable):
|
||||
"""
|
||||
An abstraction over media monitors core pyinotify functions. These include
|
||||
adding watched,store, organize directories, etc. Basically composes over
|
||||
WatchManager from pyinotify
|
||||
An abstraction over media monitors core pyinotify functions. These
|
||||
include adding watched,store, organize directories, etc. Basically
|
||||
composes over WatchManager from pyinotify
|
||||
"""
|
||||
global_inst = None
|
||||
all_signals = set(['add_watch', 'remove_watch'])
|
||||
|
@ -157,9 +157,9 @@ class Manager(Loggable):
|
|||
|
||||
def add_watch_directory(self, new_dir):
|
||||
"""
|
||||
adds a directory to be "watched". "watched" directories are those that
|
||||
are being monitored by media monitor for airtime in this context and
|
||||
not directories pyinotify calls watched
|
||||
adds a directory to be "watched". "watched" directories are
|
||||
those that are being monitored by media monitor for airtime in
|
||||
this context and not directories pyinotify calls watched
|
||||
"""
|
||||
if self.has_watch(new_dir):
|
||||
self.logger.info("Cannot add '%s' to watched directories. It's \
|
||||
|
|
|
@ -369,15 +369,6 @@ def last_modified(path):
|
|||
return os.path.getmtime(path)
|
||||
else: 0
|
||||
|
||||
def import_organize(store):
|
||||
# TODO : get rid of this later
|
||||
"""
|
||||
returns a tuple of organize and imported directory from an airtime store
|
||||
directory
|
||||
"""
|
||||
store = os.path.normpath(store)
|
||||
return os.path.join(store,'organize'), os.path.join(store,'imported')
|
||||
|
||||
def expand_storage(store):
|
||||
"""
|
||||
A storage directory usually consists of 4 different subdirectories. This
|
||||
|
|
|
@ -37,9 +37,9 @@ class RequestSync(threading.Thread,Loggable):
|
|||
try: make_req()
|
||||
# most likely we did not get json response as we expected
|
||||
except ValueError:
|
||||
self.logger.info("Api Controller is a piece of shit\n \
|
||||
it's not returning json when it should\n \
|
||||
... will fix once I setup the damn debugger")
|
||||
self.logger.info("ApiController.php probably crashed, we \
|
||||
diagnose this from the fact that it did not return \
|
||||
valid json")
|
||||
self.logger.info("Trying again after %f seconds" %
|
||||
self.request_wait)
|
||||
time.sleep( self.request_wait )
|
||||
|
@ -139,7 +139,9 @@ class WatchSyncer(ReportHandler,Loggable):
|
|||
return len(self.__requests) > 0
|
||||
|
||||
def flag_done(self):
|
||||
""" called by request thread when it finishes operating """
|
||||
"""
|
||||
called by request thread when it finishes operating
|
||||
"""
|
||||
self.request_running = False
|
||||
self.__current_thread = None
|
||||
# This call might not be necessary but we would like
|
||||
|
@ -147,7 +149,9 @@ class WatchSyncer(ReportHandler,Loggable):
|
|||
if self.requests_in_queue() > 0: self.request_do()
|
||||
|
||||
def request_do(self):
|
||||
""" launches a request thread only if one is not running right now """
|
||||
"""
|
||||
launches a request thread only if one is not running right now
|
||||
"""
|
||||
if not self.request_running:
|
||||
self.request_running = True
|
||||
self.__requests.pop()()
|
||||
|
|
Loading…
Reference in New Issue