A couple of stylistic changes

This commit is contained in:
Rudi Grinberg 2012-07-03 16:39:11 -04:00 committed by Rudi Grinberg
parent 96da87bccb
commit 4064512c83
1 changed files with 2 additions and 9 deletions

View File

@ -35,20 +35,13 @@ class MediaMonitorCommon:
# if file doesn't have any extension, info[-2] throws exception # if file doesn't have any extension, info[-2] throws exception
# Hence, checking length of info before we do anything # Hence, checking length of info before we do anything
if(len(info) >= 2): if(len(info) >= 2):
if(info[-2].lower() in self.supported_file_formats): return info[-2].lower() in self.supported_file_formats
return True
else:
return False
else: else:
return False return False
def is_audio_file(self, filename): def is_audio_file(self, filename):
info = filename.split(".") info = filename.split(".")
return info[-1].lower() in self.supported_file_formats
if(info[-1].lower() in self.supported_file_formats):
return True
else:
return False
#check if file is readable by "nobody" #check if file is readable by "nobody"
def is_user_readable(self, filepath, euid='nobody', egid='nogroup'): def is_user_readable(self, filepath, euid='nobody', egid='nogroup'):