Helpviewer/Sync/SyncHandler.py

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

eric ide

mercurial