Helpviewer/Sync/SyncHandler.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3190
a9a94491c4fd
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
56 "speeddial": "SpeedDial", 56 "speeddial": "SpeedDial",
57 } 57 }
58 58
59 self._messages = { 59 self._messages = {
60 "bookmarks": { 60 "bookmarks": {
61 "RemoteExists": self.trUtf8( 61 "RemoteExists": self.tr(
62 "Remote bookmarks file exists! Syncing local copy..."), 62 "Remote bookmarks file exists! Syncing local copy..."),
63 "RemoteMissing": self.trUtf8( 63 "RemoteMissing": self.tr(
64 "Remote bookmarks file does NOT exists. Exporting" 64 "Remote bookmarks file does NOT exists. Exporting"
65 " local copy..."), 65 " local copy..."),
66 "LocalNewer": self.trUtf8( 66 "LocalNewer": self.tr(
67 "Local bookmarks file is NEWER. Exporting local copy..."), 67 "Local bookmarks file is NEWER. Exporting local copy..."),
68 "LocalMissing": self.trUtf8( 68 "LocalMissing": self.tr(
69 "Local bookmarks file does NOT exist. Skipping" 69 "Local bookmarks file does NOT exist. Skipping"
70 " synchronization!"), 70 " synchronization!"),
71 "Uploading": self.trUtf8("Uploading local bookmarks file..."), 71 "Uploading": self.tr("Uploading local bookmarks file..."),
72 }, 72 },
73 "history": { 73 "history": {
74 "RemoteExists": self.trUtf8( 74 "RemoteExists": self.tr(
75 "Remote history file exists! Syncing local copy..."), 75 "Remote history file exists! Syncing local copy..."),
76 "RemoteMissing": self.trUtf8( 76 "RemoteMissing": self.tr(
77 "Remote history file does NOT exists. Exporting" 77 "Remote history file does NOT exists. Exporting"
78 " local copy..."), 78 " local copy..."),
79 "LocalNewer": self.trUtf8( 79 "LocalNewer": self.tr(
80 "Local history file is NEWER. Exporting local copy..."), 80 "Local history file is NEWER. Exporting local copy..."),
81 "LocalMissing": self.trUtf8( 81 "LocalMissing": self.tr(
82 "Local history file does NOT exist. Skipping" 82 "Local history file does NOT exist. Skipping"
83 " synchronization!"), 83 " synchronization!"),
84 "Uploading": self.trUtf8("Uploading local history file..."), 84 "Uploading": self.tr("Uploading local history file..."),
85 }, 85 },
86 "passwords": { 86 "passwords": {
87 "RemoteExists": self.trUtf8( 87 "RemoteExists": self.tr(
88 "Remote logins file exists! Syncing local copy..."), 88 "Remote logins file exists! Syncing local copy..."),
89 "RemoteMissing": self.trUtf8( 89 "RemoteMissing": self.tr(
90 "Remote logins file does NOT exists. Exporting" 90 "Remote logins file does NOT exists. Exporting"
91 " local copy..."), 91 " local copy..."),
92 "LocalNewer": self.trUtf8( 92 "LocalNewer": self.tr(
93 "Local logins file is NEWER. Exporting local copy..."), 93 "Local logins file is NEWER. Exporting local copy..."),
94 "LocalMissing": self.trUtf8( 94 "LocalMissing": self.tr(
95 "Local logins file does NOT exist. Skipping" 95 "Local logins file does NOT exist. Skipping"
96 " synchronization!"), 96 " synchronization!"),
97 "Uploading": self.trUtf8("Uploading local logins file..."), 97 "Uploading": self.tr("Uploading local logins file..."),
98 }, 98 },
99 "useragents": { 99 "useragents": {
100 "RemoteExists": self.trUtf8( 100 "RemoteExists": self.tr(
101 "Remote user agent settings file exists! Syncing local" 101 "Remote user agent settings file exists! Syncing local"
102 " copy..."), 102 " copy..."),
103 "RemoteMissing": self.trUtf8( 103 "RemoteMissing": self.tr(
104 "Remote user agent settings file does NOT exists." 104 "Remote user agent settings file does NOT exists."
105 " Exporting local copy..."), 105 " Exporting local copy..."),
106 "LocalNewer": self.trUtf8( 106 "LocalNewer": self.tr(
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.tr(
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( 112 "Uploading": self.tr(
113 "Uploading local user agent settings file..."), 113 "Uploading local user agent settings file..."),
114 }, 114 },
115 "speeddial": { 115 "speeddial": {
116 "RemoteExists": self.trUtf8( 116 "RemoteExists": self.tr(
117 "Remote speed dial settings file exists! Syncing local" 117 "Remote speed dial settings file exists! Syncing local"
118 " copy..."), 118 " copy..."),
119 "RemoteMissing": self.trUtf8( 119 "RemoteMissing": self.tr(
120 "Remote speed dial settings file does NOT exists." 120 "Remote speed dial settings file does NOT exists."
121 " Exporting local copy..."), 121 " Exporting local copy..."),
122 "LocalNewer": self.trUtf8( 122 "LocalNewer": self.tr(
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.tr(
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( 128 "Uploading": self.tr(
129 "Uploading local speed dial settings file..."), 129 "Uploading local speed dial settings file..."),
130 }, 130 },
131 } 131 }
132 132
133 def syncBookmarks(self): 133 def syncBookmarks(self):
257 (not Preferences.getHelp("SyncEncryptPasswordsOnly") or 257 (not Preferences.getHelp("SyncEncryptPasswordsOnly") or
258 (Preferences.getHelp("SyncEncryptPasswordsOnly") and 258 (Preferences.getHelp("SyncEncryptPasswordsOnly") and
259 type_ == "passwords")): 259 type_ == "passwords")):
260 key = Preferences.getHelp("SyncEncryptionKey") 260 key = Preferences.getHelp("SyncEncryptionKey")
261 if not key: 261 if not key:
262 return False, self.trUtf8("Invalid encryption key given.") 262 return False, self.tr("Invalid encryption key given.")
263 263
264 data, ok = dataDecrypt( 264 data, ok = dataDecrypt(
265 data, key, 265 data, key,
266 keyLength=Preferences.getHelp("SyncEncryptionKeyLength")) 266 keyLength=Preferences.getHelp("SyncEncryptionKeyLength"))
267 if not ok: 267 if not ok:
268 return False, self.trUtf8("Data cannot be decrypted.") 268 return False, self.tr("Data cannot be decrypted.")
269 269
270 try: 270 try:
271 outputFile = open(fileName, "wb") 271 outputFile = open(fileName, "wb")
272 outputFile.write(data) 272 outputFile.write(data)
273 outputFile.close() 273 outputFile.close()

eric ide

mercurial