sintonia/python_apps/airtime_analyzer/airtime_analyzer
Lucas Bickel 9ce611130c Use file-magic instead of python-magic
This gets the mime type using file-magic in a most minimal way. Since the python bindings have been available as a distro package for quite a while it is written in a way so it should also run on pre pypi installs of file-magic. This means not being able to use nice things like magic.detect_from_filename due to the fact that they where added rather recently (with recently being 2 years ago).

As the mime type is only used to check for wav files that mutagen can't handle it only reads the mime type and ignores the charset and other attributes that magic can find.

Due to the fact that file-magic is not properly unicode safe I'm checking the file based on it's first 2048 bytes as per <http://stackoverflow.com/questions/34836792/python-magic-cant-identify-unicode-filename#comment57418632_34838355>. This is not an issue since wav files need to start with a wav header by definition anyway.

I tested this sucessfully on both CentOS and Debian with files containing Unicode in their names.
2017-04-18 09:49:09 +02:00
..
__init__.py CC-5709: Airtime Analyzer 2014-03-10 16:32:23 -04:00
airtime_analyzer.py Bugfix for embedded player sending too many requests on load, quieter logging for boto 2015-04-29 11:46:44 -04:00
analyzer.py CC-5709: Airtime Analyzer 2014-04-03 16:13:26 -04:00
analyzer_pipeline.py Disable analyzer log file rotation (already handed by Upstart), clean up 2015-04-10 15:03:58 -04:00
cloud_storage_uploader.py Rewrite config from /etc/airtime-saas to plain /etc/airtime 2017-03-03 15:57:41 +01:00
cloud_storage_uploader_libcloud.py Rewrite config from /etc/airtime-saas to plain /etc/airtime 2017-03-03 15:57:41 +01:00
config_file.py Added missing config_File.py 2014-12-19 16:20:20 -05:00
cuepoint_analyzer.py Comments 2015-10-30 18:09:56 -04:00
filemover_analyzer.py Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer-cloud-storage 2014-10-22 17:16:46 -04:00
message_listener.py Another small bugfix for error handling in the analyzer 2015-04-06 17:33:08 -04:00
metadata_analyzer.py Use file-magic instead of python-magic 2017-04-18 09:49:09 +02:00
playability_analyzer.py Minor airtime_analyzer error handling improvements and documentation 2015-04-06 17:22:13 -04:00
replaygain_analyzer.py Close file descriptors in airtime_analyzer before forking subprocesses 2014-12-15 17:18:02 -05:00
status_reporter.py airtime_analyzer unit test backwards compatibility with older versions of requests 2015-07-08 10:32:35 -04:00