Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
fb7de88a30
|
@ -1,8 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
//error_reporting(E_ALL|E_STRICT);
|
error_reporting(E_ALL|E_STRICT);
|
||||||
//error_reporting(E_ALL);
|
|
||||||
//ini_set('display_errors', 'on');
|
function exception_error_handler($errno, $errstr, $errfile, $errline)
|
||||||
|
{
|
||||||
|
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
|
||||||
|
}
|
||||||
|
set_error_handler("exception_error_handler");
|
||||||
|
|
||||||
// Define path to application directory
|
// Define path to application directory
|
||||||
defined('APPLICATION_PATH')
|
defined('APPLICATION_PATH')
|
||||||
|
@ -53,6 +57,7 @@ try {
|
||||||
$application->bootstrap()->run();
|
$application->bootstrap()->run();
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -477,6 +477,7 @@ class AirtimeApiClient():
|
||||||
def list_all_db_files(self, dir_id, all_files=True):
|
def list_all_db_files(self, dir_id, all_files=True):
|
||||||
logger = self.logger
|
logger = self.logger
|
||||||
try:
|
try:
|
||||||
|
all_files = u"1" if all_files else u"0"
|
||||||
url = self.construct_url("list_all_db_files")
|
url = self.construct_url("list_all_db_files")
|
||||||
url = url.replace("%%dir_id%%", dir_id)
|
url = url.replace("%%dir_id%%", dir_id)
|
||||||
url = url.replace("%%all%%", all_files)
|
url = url.replace("%%all%%", all_files)
|
||||||
|
|
|
@ -54,6 +54,7 @@ class AirtimeNotifier(Loggable):
|
||||||
message.ack()
|
message.ack()
|
||||||
self.logger.info("Received md from RabbitMQ: %s" % str(body))
|
self.logger.info("Received md from RabbitMQ: %s" % str(body))
|
||||||
m = json.loads(message.body)
|
m = json.loads(message.body)
|
||||||
|
if 'directory' in m: m['directory'] = normpath(m['directory'])
|
||||||
self.handler.message(m)
|
self.handler.message(m)
|
||||||
|
|
||||||
class AirtimeMessageReceiver(Loggable):
|
class AirtimeMessageReceiver(Loggable):
|
||||||
|
@ -119,6 +120,7 @@ class AirtimeMessageReceiver(Loggable):
|
||||||
% md_path, e)
|
% md_path, e)
|
||||||
|
|
||||||
def new_watch(self, msg):
|
def new_watch(self, msg):
|
||||||
|
msg['directory'] = normpath(msg['directory'])
|
||||||
self.logger.info("Creating watch for directory: '%s'" %
|
self.logger.info("Creating watch for directory: '%s'" %
|
||||||
msg['directory'])
|
msg['directory'])
|
||||||
if not os.path.exists(msg['directory']):
|
if not os.path.exists(msg['directory']):
|
||||||
|
|
|
@ -296,7 +296,7 @@ def organized_path(old_path, root_path, orig_md):
|
||||||
filepath = None
|
filepath = None
|
||||||
ext = extension(old_path)
|
ext = extension(old_path)
|
||||||
def default_f(dictionary, key):
|
def default_f(dictionary, key):
|
||||||
if key in dictionary: return len(dictionary[key]) == 0
|
if key in dictionary: return len(str(dictionary[key])) == 0
|
||||||
else: return True
|
else: return True
|
||||||
# We set some metadata elements to a default "unknown" value because we use
|
# We set some metadata elements to a default "unknown" value because we use
|
||||||
# these fields to create a path hence they cannot be empty Here "normal"
|
# these fields to create a path hence they cannot be empty Here "normal"
|
||||||
|
|
Loading…
Reference in New Issue