CC-2954: Exception in media monitor using Dropbox

- This will take care of the exception issue
This commit is contained in:
James 2011-10-27 14:34:03 -04:00
parent 0188dc6c06
commit 455f10f815
1 changed files with 8 additions and 3 deletions

View File

@ -27,10 +27,15 @@ class MediaMonitorCommon:
def is_temp_file(self, filename): def is_temp_file(self, filename):
info = filename.split(".") info = filename.split(".")
# if file doesn't have any extension, info[-2] throws exception
# Hence, checking length of info before we do anything
if(len(info) >= 3):
if(info[-2] in self.supported_file_formats): if(info[-2] in self.supported_file_formats):
return True return True
else: else:
return False return False
else:
return False
def is_audio_file(self, filename): def is_audio_file(self, filename):
info = filename.split(".") info = filename.split(".")