|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.Sync.SyncHandler</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.WebBrowser.Sync.SyncHandler</h1> |
|
24 |
|
25 <p> |
|
26 Module containing a base class for synchronization handlers. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#SyncHandler">SyncHandler</a></td> |
|
39 <td>Base class for synchronization handlers.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="SyncHandler" ID="SyncHandler"></a> |
|
50 <h2>SyncHandler</h2> |
|
51 |
|
52 <p> |
|
53 Base class for synchronization handlers. |
|
54 </p> |
|
55 <h3>Signals</h3> |
|
56 <dl> |
|
57 |
|
58 <dt>syncError(message)</dt> |
|
59 <dd> |
|
60 emitted for a general error with the error |
|
61 message (string) |
|
62 </dd> |
|
63 <dt>syncFinished(type_, done, download)</dt> |
|
64 <dd> |
|
65 emitted after a |
|
66 synchronization has finished (string one of "bookmarks", "history", |
|
67 "passwords", "useragents" or "speeddial", boolean, boolean) |
|
68 </dd> |
|
69 <dt>syncMessage(message)</dt> |
|
70 <dd> |
|
71 emitted to send a message about |
|
72 synchronization (string) |
|
73 </dd> |
|
74 <dt>syncStatus(type_, message)</dt> |
|
75 <dd> |
|
76 emitted to indicate the synchronization |
|
77 status (string one of "bookmarks", "history", "passwords", |
|
78 "useragents" or "speeddial", string) |
|
79 </dd> |
|
80 </dl> |
|
81 <h3>Derived from</h3> |
|
82 QObject |
|
83 <h3>Class Attributes</h3> |
|
84 |
|
85 <table> |
|
86 <tr><td>None</td></tr> |
|
87 </table> |
|
88 <h3>Class Methods</h3> |
|
89 |
|
90 <table> |
|
91 <tr><td>None</td></tr> |
|
92 </table> |
|
93 <h3>Methods</h3> |
|
94 |
|
95 <table> |
|
96 |
|
97 <tr> |
|
98 <td><a href="#SyncHandler.__init__">SyncHandler</a></td> |
|
99 <td>Constructor</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#SyncHandler.initialLoadAndCheck">initialLoadAndCheck</a></td> |
|
103 <td>Public method to do the initial check.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#SyncHandler.readFile">readFile</a></td> |
|
107 <td>Public method to read a file.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#SyncHandler.shutdown">shutdown</a></td> |
|
111 <td>Public method to shut down the handler.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#SyncHandler.syncBookmarks">syncBookmarks</a></td> |
|
115 <td>Public method to synchronize the bookmarks.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#SyncHandler.syncHistory">syncHistory</a></td> |
|
119 <td>Public method to synchronize the history.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#SyncHandler.syncPasswords">syncPasswords</a></td> |
|
123 <td>Public method to synchronize the passwords.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#SyncHandler.syncSpeedDial">syncSpeedDial</a></td> |
|
127 <td>Public method to synchronize the speed dial data.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#SyncHandler.syncUserAgents">syncUserAgents</a></td> |
|
131 <td>Public method to synchronize the user agents.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#SyncHandler.writeFile">writeFile</a></td> |
|
135 <td>Public method to write the data to a file.</td> |
|
136 </tr> |
|
137 </table> |
|
138 <h3>Static Methods</h3> |
|
139 |
|
140 <table> |
|
141 <tr><td>None</td></tr> |
|
142 </table> |
|
143 |
|
144 <a NAME="SyncHandler.__init__" ID="SyncHandler.__init__"></a> |
|
145 <h4>SyncHandler (Constructor)</h4> |
|
146 <b>SyncHandler</b>(<i>parent=None</i>) |
|
147 |
|
148 <p> |
|
149 Constructor |
|
150 </p> |
|
151 <dl> |
|
152 |
|
153 <dt><i>parent</i></dt> |
|
154 <dd> |
|
155 reference to the parent object (QObject) |
|
156 </dd> |
|
157 </dl> |
|
158 <a NAME="SyncHandler.initialLoadAndCheck" ID="SyncHandler.initialLoadAndCheck"></a> |
|
159 <h4>SyncHandler.initialLoadAndCheck</h4> |
|
160 <b>initialLoadAndCheck</b>(<i>forceUpload</i>) |
|
161 |
|
162 <p> |
|
163 Public method to do the initial check. |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>forceUpload</i></dt> |
|
168 <dd> |
|
169 flag indicating a forced upload of the files |
|
170 (boolean) |
|
171 </dd> |
|
172 </dl> |
|
173 <dl> |
|
174 |
|
175 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
176 <dd> |
|
177 raised to indicate that this method |
|
178 must be implemented by subclasses |
|
179 </dd> |
|
180 </dl> |
|
181 <a NAME="SyncHandler.readFile" ID="SyncHandler.readFile"></a> |
|
182 <h4>SyncHandler.readFile</h4> |
|
183 <b>readFile</b>(<i>fileName, type_</i>) |
|
184 |
|
185 <p> |
|
186 Public method to read a file. |
|
187 </p> |
|
188 <p> |
|
189 If encrypted synchronization is enabled, the data will be encrypted |
|
190 using the relevant encryption key. |
|
191 </p> |
|
192 <dl> |
|
193 |
|
194 <dt><i>fileName</i></dt> |
|
195 <dd> |
|
196 name of the file to be read (string) |
|
197 </dd> |
|
198 <dt><i>type_</i></dt> |
|
199 <dd> |
|
200 type of the synchronization event (string one |
|
201 of "bookmarks", "history", "passwords", "useragents" or |
|
202 "speeddial") |
|
203 </dd> |
|
204 </dl> |
|
205 <dl> |
|
206 <dt>Return:</dt> |
|
207 <dd> |
|
208 data of the file, optionally encrypted (QByteArray) |
|
209 </dd> |
|
210 </dl> |
|
211 <a NAME="SyncHandler.shutdown" ID="SyncHandler.shutdown"></a> |
|
212 <h4>SyncHandler.shutdown</h4> |
|
213 <b>shutdown</b>(<i></i>) |
|
214 |
|
215 <p> |
|
216 Public method to shut down the handler. |
|
217 </p> |
|
218 <dl> |
|
219 |
|
220 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
221 <dd> |
|
222 raised to indicate that this method |
|
223 must be implemented by subclasses |
|
224 </dd> |
|
225 </dl> |
|
226 <a NAME="SyncHandler.syncBookmarks" ID="SyncHandler.syncBookmarks"></a> |
|
227 <h4>SyncHandler.syncBookmarks</h4> |
|
228 <b>syncBookmarks</b>(<i></i>) |
|
229 |
|
230 <p> |
|
231 Public method to synchronize the bookmarks. |
|
232 </p> |
|
233 <dl> |
|
234 |
|
235 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
236 <dd> |
|
237 raised to indicate that this method |
|
238 must be implemented by subclasses |
|
239 </dd> |
|
240 </dl> |
|
241 <a NAME="SyncHandler.syncHistory" ID="SyncHandler.syncHistory"></a> |
|
242 <h4>SyncHandler.syncHistory</h4> |
|
243 <b>syncHistory</b>(<i></i>) |
|
244 |
|
245 <p> |
|
246 Public method to synchronize the history. |
|
247 </p> |
|
248 <dl> |
|
249 |
|
250 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
251 <dd> |
|
252 raised to indicate that this method |
|
253 must be implemented by subclasses |
|
254 </dd> |
|
255 </dl> |
|
256 <a NAME="SyncHandler.syncPasswords" ID="SyncHandler.syncPasswords"></a> |
|
257 <h4>SyncHandler.syncPasswords</h4> |
|
258 <b>syncPasswords</b>(<i></i>) |
|
259 |
|
260 <p> |
|
261 Public method to synchronize the passwords. |
|
262 </p> |
|
263 <dl> |
|
264 |
|
265 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
266 <dd> |
|
267 raised to indicate that this method |
|
268 must be implemented by subclasses |
|
269 </dd> |
|
270 </dl> |
|
271 <a NAME="SyncHandler.syncSpeedDial" ID="SyncHandler.syncSpeedDial"></a> |
|
272 <h4>SyncHandler.syncSpeedDial</h4> |
|
273 <b>syncSpeedDial</b>(<i></i>) |
|
274 |
|
275 <p> |
|
276 Public method to synchronize the speed dial data. |
|
277 </p> |
|
278 <dl> |
|
279 |
|
280 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
281 <dd> |
|
282 raised to indicate that this method |
|
283 must be implemented by subclasses |
|
284 </dd> |
|
285 </dl> |
|
286 <a NAME="SyncHandler.syncUserAgents" ID="SyncHandler.syncUserAgents"></a> |
|
287 <h4>SyncHandler.syncUserAgents</h4> |
|
288 <b>syncUserAgents</b>(<i></i>) |
|
289 |
|
290 <p> |
|
291 Public method to synchronize the user agents. |
|
292 </p> |
|
293 <dl> |
|
294 |
|
295 <dt>Raises <b>NotImplementedError</b>:</dt> |
|
296 <dd> |
|
297 raised to indicate that this method |
|
298 must be implemented by subclasses |
|
299 </dd> |
|
300 </dl> |
|
301 <a NAME="SyncHandler.writeFile" ID="SyncHandler.writeFile"></a> |
|
302 <h4>SyncHandler.writeFile</h4> |
|
303 <b>writeFile</b>(<i>data, fileName, type_, timestamp=0</i>) |
|
304 |
|
305 <p> |
|
306 Public method to write the data to a file. |
|
307 </p> |
|
308 <p> |
|
309 If encrypted synchronization is enabled, the data will be decrypted |
|
310 using the relevant encryption key. |
|
311 </p> |
|
312 <dl> |
|
313 |
|
314 <dt><i>data</i></dt> |
|
315 <dd> |
|
316 data to be written and optionally decrypted (QByteArray) |
|
317 </dd> |
|
318 <dt><i>fileName</i></dt> |
|
319 <dd> |
|
320 name of the file the data is to be written to (string) |
|
321 </dd> |
|
322 <dt><i>type_</i></dt> |
|
323 <dd> |
|
324 type of the synchronization event (string one |
|
325 of "bookmarks", "history", "passwords", "useragents" or |
|
326 "speeddial") |
|
327 </dd> |
|
328 <dt><i>timestamp</i></dt> |
|
329 <dd> |
|
330 timestamp to be given to the file (int) |
|
331 </dd> |
|
332 </dl> |
|
333 <dl> |
|
334 <dt>Return:</dt> |
|
335 <dd> |
|
336 tuple giving a success flag and an error string (boolean, |
|
337 string) |
|
338 </dd> |
|
339 </dl> |
|
340 <div align="right"><a href="#top">Up</a></div> |
|
341 <hr /> |
|
342 </body></html> |