code cleanup
-changed module name to correct naming convention -remove some unused imports
This commit is contained in:
parent
9612adf72e
commit
dec68649c1
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import replay_gain
|
import replaygain
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -126,7 +126,7 @@ class AirtimeMetadata:
|
||||||
|
|
||||||
md = {}
|
md = {}
|
||||||
|
|
||||||
replay_gain_val = replay_gain.calculate_replay_gain(filepath)
|
replay_gain_val = replaygain.calculate_replay_gain(filepath)
|
||||||
self.logger.info('ReplayGain calculated as %s for %s' % (replay_gain_val, filepath))
|
self.logger.info('ReplayGain calculated as %s for %s' % (replay_gain_val, filepath))
|
||||||
md['MDATA_KEY_REPLAYGAIN'] = replay_gain_val
|
md['MDATA_KEY_REPLAYGAIN'] = replay_gain_val
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ class MediaMonitorCommon:
|
||||||
def is_readable(self, item, is_dir):
|
def is_readable(self, item, is_dir):
|
||||||
try:
|
try:
|
||||||
return self.is_user_readable(item, 'www-data', 'www-data')
|
return self.is_user_readable(item, 'www-data', 'www-data')
|
||||||
except Exception, e:
|
except Exception:
|
||||||
self.logger.warn(u"Failed to check owner/group/permissions for %s", item)
|
self.logger.warn(u"Failed to check owner/group/permissions for %s", item)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class MediaMonitorCommon:
|
||||||
try:
|
try:
|
||||||
os.rmdir(dir)
|
os.rmdir(dir)
|
||||||
self.cleanup_empty_dirs(os.path.dirname(dir))
|
self.cleanup_empty_dirs(os.path.dirname(dir))
|
||||||
except Exception, e:
|
except Exception:
|
||||||
#non-critical exception because we probably tried to delete a non-empty dir.
|
#non-critical exception because we probably tried to delete a non-empty dir.
|
||||||
#Don't need to log this, let's just "return"
|
#Don't need to log this, let's just "return"
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import logging
|
|
||||||
import logging.config
|
import logging.config
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import signal
|
|
||||||
import traceback
|
import traceback
|
||||||
import locale
|
import locale
|
||||||
|
|
||||||
|
@ -14,7 +12,7 @@ from configobj import ConfigObj
|
||||||
from api_clients import api_client as apc
|
from api_clients import api_client as apc
|
||||||
from std_err_override import LogWriter
|
from std_err_override import LogWriter
|
||||||
|
|
||||||
from multiprocessing import Process, Queue as mpQueue
|
from multiprocessing import Queue as mpQueue
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue