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