eric6/WebBrowser/Sync/SyncHandler.py

changeset 7836
2f0d208b8137
parent 7785
9978016560ec
child 7900
72b88fb20261
child 7924
8a96736d465e
equal deleted inserted replaced
7835:0835ed67714b 7836:2f0d208b8137
208 """ 208 """
209 if os.path.exists(fileName): 209 if os.path.exists(fileName):
210 try: 210 try:
211 with open(fileName, "rb") as inputFile: 211 with open(fileName, "rb") as inputFile:
212 data = inputFile.read() 212 data = inputFile.read()
213 except IOError: 213 except OSError:
214 return QByteArray() 214 return QByteArray()
215 215
216 if ( 216 if (
217 Preferences.getWebBrowser("SyncEncryptData") and 217 Preferences.getWebBrowser("SyncEncryptData") and
218 (not Preferences.getWebBrowser("SyncEncryptPasswordsOnly") or 218 (not Preferences.getWebBrowser("SyncEncryptPasswordsOnly") or
273 with open(fileName, "wb") as outputFile: 273 with open(fileName, "wb") as outputFile:
274 outputFile.write(data) 274 outputFile.write(data)
275 if timestamp > 0: 275 if timestamp > 0:
276 os.utime(fileName, (timestamp, timestamp)) 276 os.utime(fileName, (timestamp, timestamp))
277 return True, "" 277 return True, ""
278 except IOError as error: 278 except OSError as error:
279 return False, str(error) 279 return False, str(error)

eric ide

mercurial