Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
fb7de88a30
|
@ -1,8 +1,12 @@
|
|||
<?php
|
||||
|
||||
//error_reporting(E_ALL|E_STRICT);
|
||||
//error_reporting(E_ALL);
|
||||
//ini_set('display_errors', 'on');
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
|
||||
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
|
||||
defined('APPLICATION_PATH')
|
||||
|
@ -53,6 +57,7 @@ try {
|
|||
$application->bootstrap()->run();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -477,6 +477,7 @@ class AirtimeApiClient():
|
|||
def list_all_db_files(self, dir_id, all_files=True):
|
||||
logger = self.logger
|
||||
try:
|
||||
all_files = u"1" if all_files else u"0"
|
||||
url = self.construct_url("list_all_db_files")
|
||||
url = url.replace("%%dir_id%%", dir_id)
|
||||
url = url.replace("%%all%%", all_files)
|
||||
|
|
|
@ -54,6 +54,7 @@ class AirtimeNotifier(Loggable):
|
|||
message.ack()
|
||||
self.logger.info("Received md from RabbitMQ: %s" % str(body))
|
||||
m = json.loads(message.body)
|
||||
if 'directory' in m: m['directory'] = normpath(m['directory'])
|
||||
self.handler.message(m)
|
||||
|
||||
class AirtimeMessageReceiver(Loggable):
|
||||
|
@ -119,6 +120,7 @@ class AirtimeMessageReceiver(Loggable):
|
|||
% md_path, e)
|
||||
|
||||
def new_watch(self, msg):
|
||||
msg['directory'] = normpath(msg['directory'])
|
||||
self.logger.info("Creating watch for directory: '%s'" %
|
||||
msg['directory'])
|
||||
if not os.path.exists(msg['directory']):
|
||||
|
|
|
@ -296,7 +296,7 @@ def organized_path(old_path, root_path, orig_md):
|
|||
filepath = None
|
||||
ext = extension(old_path)
|
||||
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
|
||||
# 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"
|
||||
|
|
Loading…
Reference in New Issue