Fix screenshot name detection.

This commit is contained in:
Loudrob 2015-03-13 20:33:54 -04:00
parent 43ef591bb1
commit 40ada7cdf1

View file

@ -121,7 +121,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage):
oldName = self.selectedFileName oldName = self.selectedFileName
numUnders = oldName.count(separator) numUnders = oldName.count(separator)
if numUnders == 0: if numUnders == 0:
newName = oldName[0:21] + separator + str + separator + oldName[20:] newName = oldName[0:18] + separator + str + separator + oldName[17:]
elif numUnders == 2: elif numUnders == 2:
sp = oldName.split(separator) sp = oldName.split(separator)
newName = sp[0] + separator + str + separator + sp[2] newName = sp[0] + separator + str + separator + sp[2]
@ -232,7 +232,7 @@ class PhotoAlbumPage(ShtikerPage.ShtikerPage):
files = os.listdir(self.photoPath) files = os.listdir(self.photoPath)
photos = [] photos = []
for fileName in files: for fileName in files:
if fileName[0:20] == 'united-screenshot' and fileName[-4:] == '.jpg': if fileName[0:17] == 'united-screenshot' and fileName[-4:] == '.jpg':
photos.append(fileName) photos.append(fileName)
return photos return photos