configure locale for pypo

This commit is contained in:
Martin Konecny 2012-04-27 17:25:12 -04:00
parent 47051c460e
commit cf1e9e7615
3 changed files with 45 additions and 10 deletions

View file

@ -88,10 +88,10 @@ class AirtimeMediaMonitorBootstrap():
for file in files['files']:
db_known_files_set.add(file)
new_files = self.mmc.scan_dir_for_new_files(dir)
all_files = self.mmc.scan_dir_for_new_files(dir)
all_files_set = set()
for file_path in new_files:
for file_path in all_files:
if len(file_path.strip(" \n")) > 0:
all_files_set.add(file_path[len(dir):])
@ -106,8 +106,8 @@ class AirtimeMediaMonitorBootstrap():
else:
command = "find %s -type f -iname '*.ogg' -o -iname '*.mp3' -readable" % dir
self.logger.debug(command)
stdout = self.mmc.exec_command(command)
#self.logger.info(stdout)
new_files = stdout.splitlines()
@ -150,7 +150,6 @@ class AirtimeMediaMonitorBootstrap():
if os.path.exists(full_file_path):
self.pe.handle_created_file(False, full_file_path, os.path.basename(full_file_path))
for file_path in modified_files_set:
self.logger.debug("modified file")
full_file_path = "%s%s" % (dir, file_path)

View file

@ -25,7 +25,7 @@ from airtimefilemonitor.mediaconfig import AirtimeMediaConfig
from airtimefilemonitor.workerprocess import MediaMonitorWorkerProcess
from airtimefilemonitor.airtimemediamonitorbootstrap import AirtimeMediaMonitorBootstrap
def get_locale():
def configure_locale():
current_locale = locale.getlocale()
if current_locale[1] is None:
@ -70,7 +70,7 @@ logger.info("\n\n*** Media Monitor bootup ***\n\n")
try:
get_locale()
configure_locale()
config = AirtimeMediaConfig(logger)
api_client = apc.api_client_factory(config.cfg)