small fix - add folder Downloads for attachmets

This commit is contained in:
bartekn80 2013-07-15 21:09:16 +02:00
parent bdf6741016
commit 3382bd46c5

View File

@ -448,6 +448,9 @@ class MyForm(QtGui.QMainWindow):
filename=self.attachArray[int(link)]['filename'] filename=self.attachArray[int(link)]['filename']
filename=filename.replace('"','') filename=filename.replace('"','')
if(os.path.isdir('Downloads')==False):
os.mkdir('Downloads')
f = open("Downloads/"+filename, 'w') f = open("Downloads/"+filename, 'w')
data=self.attachArray[int(link)]['content'].replace('\n','') data=self.attachArray[int(link)]['content'].replace('\n','')
if(self.attachArray[int(link)]['encode'].find('base64')>-1): if(self.attachArray[int(link)]['encode'].find('base64')>-1):