diff --git a/debian/control b/debian/control index 97cfca584..c4e5663e9 100644 --- a/debian/control +++ b/debian/control @@ -36,6 +36,7 @@ Depends: apache2, php5-gd, php-pear, php5-pgsql, + python, rabbitmq-server, sudo, sysv-rc, diff --git a/gen-snapshot.sh b/gen-snapshot.sh index 27fb105a4..d98899993 100755 --- a/gen-snapshot.sh +++ b/gen-snapshot.sh @@ -61,13 +61,17 @@ rm -r airtime/airtime_mvc/library/ZFDebug/ #Strip un-needed install scripts rm -r airtime/install_full/ +#Fix permissions +chmod -x airtime/python_apps/media-monitor2/mm1.99.sh + ############################# echo "running the build..." debuild -b -uc -us $@ || exit -exit - -# optionally, copy the new package to the public server +# copy the new package to the public server scp /tmp/airtime_${VERSION}_all.deb apt.sourcefabric.org:/var/www/apt/snapshots/ + +# copy the build log too +scp /tmp/airtime_${VERSION}_amd64.build apt.sourcefabric.org:/var/www/apt/snapshots/ diff --git a/python_apps/media-monitor2/media/monitor/eventcontractor.py b/python_apps/media-monitor2/media/monitor/eventcontractor.py index cf1669210..0ac0e3278 100644 --- a/python_apps/media-monitor2/media/monitor/eventcontractor.py +++ b/python_apps/media-monitor2/media/monitor/eventcontractor.py @@ -47,4 +47,6 @@ class EventContractor(Loggable): return True # We actually added something, hence we return true. # events are unregistered automatically no need to screw around with them - def __unregister(self, evt): del self.store[evt.path] + def __unregister(self, evt): + try: del self.store[evt.path] + except Exception as e: self.unexpected_exception(e) diff --git a/python_apps/media-monitor2/media/monitor/pure.py b/python_apps/media-monitor2/media/monitor/pure.py index 93e60bbbe..ceb37cd6c 100644 --- a/python_apps/media-monitor2/media/monitor/pure.py +++ b/python_apps/media-monitor2/media/monitor/pure.py @@ -14,6 +14,7 @@ from configobj import ConfigObj from media.monitor.exceptions import FailedToSetLocale, FailedToCreateDir supported_extensions = [u"mp3", u"ogg", u"oga"] +#supported_extensions = [u"mp3", u"ogg", u"oga", u"flac", u"aac", u"bwf"] unicode_unknown = u'unknown' class LazyProperty(object): @@ -182,8 +183,7 @@ def remove_whitespace(dictionary): if hasattr(v,'strip'): stripped = v.strip() # ghetto and maybe unnecessary - if stripped == '' or stripped == u'': - bad_keys.append(k) + if stripped == '' or stripped == u'': bad_keys.append(k) for bad_key in bad_keys: del nd[bad_key] return nd @@ -200,8 +200,7 @@ def parse_int(s): """ if s.isdigit(): return s else: - try: - return reduce(op.add, takewhile(lambda x: x.isdigit(), s)) + try : return reduce(op.add, takewhile(lambda x: x.isdigit(), s)) except: return 0 def normalized_metadata(md, original_path): @@ -212,8 +211,7 @@ def normalized_metadata(md, original_path): """ new_md = copy.deepcopy(md) # replace all slashes with dashes - for k,v in new_md.iteritems(): - new_md[k] = unicode(v).replace('/','-') + for k,v in new_md.iteritems(): new_md[k] = unicode(v).replace('/','-') # Specific rules that are applied in a per attribute basis format_rules = { # It's very likely that the following isn't strictly necessary. But the @@ -244,7 +242,7 @@ def normalized_metadata(md, original_path): # Note: I don't know why I'm doing a unicode string comparison here # that part is copied from the original code if is_airtime_recorded(new_md): - hour,minute,second,name = md['MDATA_KEY_TITLE'].split("-",4) + hour,minute,second,name = md['MDATA_KEY_TITLE'].split("-",3) # We assume that MDATA_KEY_YEAR is always given for airtime recorded # shows new_md['MDATA_KEY_TITLE'] = u'%s-%s-%s:%s:%s' % \ diff --git a/python_apps/media-monitor2/mm2.py b/python_apps/media-monitor2/mm2.py index b30ef7284..a8a3dfb26 100644 --- a/python_apps/media-monitor2/mm2.py +++ b/python_apps/media-monitor2/mm2.py @@ -57,9 +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: - f = open(config['index_path']) - f.write(" ") - f.close() + with open(config['index_path']) as f: f.write(" ") except Exception as e: log.info("Failed to create index file with exception: %s" % str(e)) else: @@ -141,11 +139,6 @@ Options: --log= log config at """ - #original debugging paths - #base_path = u'/home/rudi/Airtime/python_apps/media-monitor2/tests' - #global_config = os.path.join(base_path, u'live_client.cfg') - #api_client_config = global_config - if __name__ == '__main__': from docopt import docopt args = docopt(__doc__,version="mm1.99")