cc-2419: media monitor import on startup
-fixed support for watched dirs
This commit is contained in:
parent
c67e711a05
commit
df1dec2078
7 changed files with 38 additions and 22 deletions
|
@ -61,6 +61,13 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
#file needs to be readable by all users, and directories
|
||||
#up to this file needs to be readable AND executable by all
|
||||
#users.
|
||||
def has_correct_permissions(self, filepath):
|
||||
st = os.stat(filepath)
|
||||
return bool(st.st_mode & stat.S_IROTH)
|
||||
|
||||
def set_needed_file_permissions(self, item, is_dir):
|
||||
|
||||
|
@ -100,7 +107,7 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
omask = os.umask(0)
|
||||
os.rename(source, dest)
|
||||
except Exception, e:
|
||||
self.logger.error("failed to move file.")
|
||||
self.logger.error("failed to move file. %s", e)
|
||||
finally:
|
||||
os.umask(omask)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue