Helpviewer/Sync/SyncHandler.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3022
57179e4cdadd
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
107 "Local user agent settings file is NEWER. Exporting" 107 "Local user agent settings file is NEWER. Exporting"
108 " local copy..."), 108 " local copy..."),
109 "LocalMissing": self.trUtf8( 109 "LocalMissing": self.trUtf8(
110 "Local user agent settings file does NOT exist." 110 "Local user agent settings file does NOT exist."
111 " Skipping synchronization!"), 111 " Skipping synchronization!"),
112 "Uploading": self.trUtf8("Uploading local user agent" 112 "Uploading": self.trUtf8(
113 " settings file..."), 113 "Uploading local user agent settings file..."),
114 }, 114 },
115 "speeddial": { 115 "speeddial": {
116 "RemoteExists": self.trUtf8( 116 "RemoteExists": self.trUtf8(
117 "Remote speed dial settings file exists! Syncing local" 117 "Remote speed dial settings file exists! Syncing local"
118 " copy..."), 118 " copy..."),
123 "Local speed dial settings file is NEWER. Exporting" 123 "Local speed dial settings file is NEWER. Exporting"
124 " local copy..."), 124 " local copy..."),
125 "LocalMissing": self.trUtf8( 125 "LocalMissing": self.trUtf8(
126 "Local speed dial settings file does NOT exist." 126 "Local speed dial settings file does NOT exist."
127 " Skipping synchronization!"), 127 " Skipping synchronization!"),
128 "Uploading": self.trUtf8("Uploading local speed dial" 128 "Uploading": self.trUtf8(
129 " settings file..."), 129 "Uploading local speed dial settings file..."),
130 }, 130 },
131 } 131 }
132 132
133 def syncBookmarks(self): 133 def syncBookmarks(self):
134 """ 134 """
222 type_ == "passwords")): 222 type_ == "passwords")):
223 key = Preferences.getHelp("SyncEncryptionKey") 223 key = Preferences.getHelp("SyncEncryptionKey")
224 if not key: 224 if not key:
225 return QByteArray() 225 return QByteArray()
226 226
227 data, ok = dataEncrypt(data, key, 227 data, ok = dataEncrypt(
228 data, key,
228 keyLength=Preferences.getHelp("SyncEncryptionKeyLength"), 229 keyLength=Preferences.getHelp("SyncEncryptionKeyLength"),
229 hashIterations=100) 230 hashIterations=100)
230 if not ok: 231 if not ok:
231 return QByteArray() 232 return QByteArray()
232 233
258 type_ == "passwords")): 259 type_ == "passwords")):
259 key = Preferences.getHelp("SyncEncryptionKey") 260 key = Preferences.getHelp("SyncEncryptionKey")
260 if not key: 261 if not key:
261 return False, self.trUtf8("Invalid encryption key given.") 262 return False, self.trUtf8("Invalid encryption key given.")
262 263
263 data, ok = dataDecrypt(data, key, 264 data, ok = dataDecrypt(
265 data, key,
264 keyLength=Preferences.getHelp("SyncEncryptionKeyLength")) 266 keyLength=Preferences.getHelp("SyncEncryptionKeyLength"))
265 if not ok: 267 if not ok:
266 return False, self.trUtf8("Data cannot be decrypted.") 268 return False, self.trUtf8("Data cannot be decrypted.")
267 269
268 try: 270 try:

eric ide

mercurial