Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Rudi Grinberg 2012-11-02 14:59:02 -04:00
commit aec11feba5
62 changed files with 918 additions and 868 deletions

View file

@ -256,3 +256,10 @@ class Manager(Loggable):
notifier = pyinotify.Notifier(self.wm)
notifier.coalesce_events()
notifier.loop()
#notifier = pyinotify.ThreadedNotifier(self.wm, read_freq=1)
#notifier.coalesce_events()
#notifier.start()
#return notifier
#import asyncore
#notifier = pyinotify.AsyncNotifier(self.wm)
#asyncore.loop()

View file

@ -56,7 +56,10 @@ class ReplayGainUpdater(Thread, Loggable):
full_path = os.path.join(dir_path, f['fp'])
processed_data.append((f['id'], replaygain.calculate_replay_gain(full_path)))
self.api_client.update_replay_gain_values(processed_data)
try:
self.api_client.update_replay_gain_values(processed_data)
except Exception as e: self.unexpected_exception(e)
if len(files) == 0: break
self.logger.info("Processed: %d songs" % total)

View file

@ -24,6 +24,7 @@ import media.monitor.pure as mmp
from api_clients import api_client as apc
def main(global_config, api_client_config, log_config,
index_create_attempt=False):
for cfg in [global_config, api_client_config]:
@ -134,7 +135,7 @@ def main(global_config, api_client_config, log_config,
apiclient.register_component('media-monitor')
manager.loop()
return manager.loop()
__doc__ = """
Usage:
@ -147,6 +148,9 @@ Options:
--log=<path> log config at <path>
"""
def main_loop():
while True: pass
if __name__ == '__main__':
from docopt import docopt
args = docopt(__doc__,version="mm1.99")
@ -156,3 +160,5 @@ if __name__ == '__main__':
sys.exit(0)
print("Running mm1.99")
main(args['--config'],args['--apiclient'],args['--log'])
#gevent.joinall([ gevent.spawn(main_loop) ])