CC-1799 Put Airtime Storage into a Human Readable File Naming Convention

experimenting with plupload.
This commit is contained in:
Naomi Aro 2011-06-13 12:41:30 +02:00
parent 8d9c0dab1a
commit 8a15144dc8
2 changed files with 10 additions and 12 deletions

View file

@ -734,7 +734,10 @@ class StoredFile {
} }
} }
else { else {
global $CC_CONFIG;
$stor = $CC_CONFIG["storageDir"];
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
$r = @copy($audio_file, $audio_stor);
} }
} }

View file

@ -29,7 +29,6 @@ MODE_CREATE = "create"
MODE_MODIFY = "modify" MODE_MODIFY = "modify"
global storage_directory global storage_directory
global plupload_directory
# configure logging # configure logging
try: try:
@ -297,13 +296,13 @@ class MediaMonitor(ProcessEvent):
#shutil.move(event.pathname, filepath) #shutil.move(event.pathname, filepath)
os.rename(event.pathname, filepath) os.rename(event.pathname, filepath)
try: #try:
#set the owner of the imported file. #set the owner of the imported file.
pypo_uid = getpwnam('pypo')[2] #pypo_uid = getpwnam('pypo')[2]
os.chown(filepath, pypo_uid, -1) #os.chown(filepath, pypo_uid, -1)
except Exception, e: #except Exception, e:
self.logger.debug("Cannot change owner of file.") #self.logger.debug("Cannot change owner of file.")
self.logger.debug("Error: %s:", e) #self.logger.debug("Error: %s:", e)
self.update_airtime(filepath, MODE_CREATE) self.update_airtime(filepath, MODE_CREATE)
@ -380,10 +379,6 @@ if __name__ == '__main__':
logger.info("Added watch to %s", storage_directory) logger.info("Added watch to %s", storage_directory)
logger.info("wdd result %s", wdd[storage_directory]) logger.info("wdd result %s", wdd[storage_directory])
wdd = wm.add_watch(plupload_directory, mask, rec=False, auto_add=True)
logger.info("Added watch to %s", plupload_directory)
logger.info("wdd result %s", wdd[plupload_directory])
notifier = AirtimeNotifier(wm, mm, read_freq=int(config["check_filesystem_events"]), timeout=1) notifier = AirtimeNotifier(wm, mm, read_freq=int(config["check_filesystem_events"]), timeout=1)
notifier.coalesce_events() notifier.coalesce_events()
notifier.loop(callback=mm.check_rabbit_MQ) notifier.loop(callback=mm.check_rabbit_MQ)