|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.SafeBrowsing.SafeBrowsingUrl</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.SafeBrowsing.SafeBrowsingUrl</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing an URL representation suitable for Google Safe Browsing. |
|
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="#SafeBrowsingUrl">SafeBrowsingUrl</a></td> |
|
25 <td>Class implementing an URL representation suitable for Google Safe Browsing.</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="SafeBrowsingUrl" ID="SafeBrowsingUrl"></a> |
|
36 <h2>SafeBrowsingUrl</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing an URL representation suitable for Google Safe Browsing. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 None |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#SafeBrowsingUrl.__init__">SafeBrowsingUrl</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#SafeBrowsingUrl.canonical">canonical</a></td> |
|
63 <td>Public method to convert the URL to the canonical form.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#SafeBrowsingUrl.fullUnescape">fullUnescape</a></td> |
|
67 <td>Method to recursively unescape an URL.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#SafeBrowsingUrl.hashes">hashes</a></td> |
|
71 <td>Public method to get the hashes of all possible permutations of the URL in canonical form.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#SafeBrowsingUrl.hostPermutations">hostPermutations</a></td> |
|
75 <td>Method to generate the permutations of the host name.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#SafeBrowsingUrl.pathPermutations">pathPermutations</a></td> |
|
79 <td>Method to generate the permutations of the path.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#SafeBrowsingUrl.quote">quote</a></td> |
|
83 <td>Method to quote a string.</td> |
|
84 </tr> |
|
85 </table> |
|
86 <h3>Static Methods</h3> |
|
87 |
|
88 <table> |
|
89 |
|
90 <tr> |
|
91 <td><a href="#SafeBrowsingUrl.digest">digest</a></td> |
|
92 <td>Static method to calculate the SHA256 digest of an URL string.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#SafeBrowsingUrl.permutations">permutations</a></td> |
|
96 <td>Static method to determine all permutations of host name and path which can be applied to blacklisted URLs.</td> |
|
97 </tr> |
|
98 </table> |
|
99 |
|
100 <a NAME="SafeBrowsingUrl.__init__" ID="SafeBrowsingUrl.__init__"></a> |
|
101 <h4>SafeBrowsingUrl (Constructor)</h4> |
|
102 <b>SafeBrowsingUrl</b>(<i>url</i>) |
|
103 |
|
104 <p> |
|
105 Constructor |
|
106 </p> |
|
107 <dl> |
|
108 |
|
109 <dt><i>url</i> (str)</dt> |
|
110 <dd> |
|
111 URL to be embedded |
|
112 </dd> |
|
113 </dl> |
|
114 <a NAME="SafeBrowsingUrl.canonical" ID="SafeBrowsingUrl.canonical"></a> |
|
115 <h4>SafeBrowsingUrl.canonical</h4> |
|
116 <b>canonical</b>(<i></i>) |
|
117 |
|
118 <p> |
|
119 Public method to convert the URL to the canonical form. |
|
120 </p> |
|
121 <dl> |
|
122 <dt>Return:</dt> |
|
123 <dd> |
|
124 canonical form of the URL |
|
125 </dd> |
|
126 </dl> |
|
127 <dl> |
|
128 <dt>Return Type:</dt> |
|
129 <dd> |
|
130 str |
|
131 </dd> |
|
132 </dl> |
|
133 <a NAME="SafeBrowsingUrl.fullUnescape" ID="SafeBrowsingUrl.fullUnescape"></a> |
|
134 <h4>SafeBrowsingUrl.fullUnescape</h4> |
|
135 <b>fullUnescape</b>(<i></i>) |
|
136 |
|
137 <p> |
|
138 Method to recursively unescape an URL. |
|
139 </p> |
|
140 <dl> |
|
141 |
|
142 <dt><i>u</i> (str)</dt> |
|
143 <dd> |
|
144 URL string to unescape |
|
145 </dd> |
|
146 </dl> |
|
147 <dl> |
|
148 <dt>Return:</dt> |
|
149 <dd> |
|
150 unescaped URL string |
|
151 </dd> |
|
152 </dl> |
|
153 <dl> |
|
154 <dt>Return Type:</dt> |
|
155 <dd> |
|
156 str |
|
157 </dd> |
|
158 </dl> |
|
159 <a NAME="SafeBrowsingUrl.hashes" ID="SafeBrowsingUrl.hashes"></a> |
|
160 <h4>SafeBrowsingUrl.hashes</h4> |
|
161 <b>hashes</b>(<i></i>) |
|
162 |
|
163 <p> |
|
164 Public method to get the hashes of all possible permutations of the URL |
|
165 in canonical form. |
|
166 </p> |
|
167 <dl> |
|
168 <dt>Yield:</dt> |
|
169 <dd> |
|
170 URL hashes |
|
171 </dd> |
|
172 </dl> |
|
173 <dl> |
|
174 <dt>Yield Type:</dt> |
|
175 <dd> |
|
176 bytes |
|
177 </dd> |
|
178 </dl> |
|
179 <a NAME="SafeBrowsingUrl.hostPermutations" ID="SafeBrowsingUrl.hostPermutations"></a> |
|
180 <h4>SafeBrowsingUrl.hostPermutations</h4> |
|
181 <b>hostPermutations</b>(<i></i>) |
|
182 |
|
183 <p> |
|
184 Method to generate the permutations of the host name. |
|
185 </p> |
|
186 <dl> |
|
187 |
|
188 <dt><i>host</i> (str)</dt> |
|
189 <dd> |
|
190 host name |
|
191 </dd> |
|
192 </dl> |
|
193 <dl> |
|
194 <dt>Yield:</dt> |
|
195 <dd> |
|
196 permutated host names |
|
197 </dd> |
|
198 </dl> |
|
199 <dl> |
|
200 <dt>Yield Type:</dt> |
|
201 <dd> |
|
202 str |
|
203 </dd> |
|
204 </dl> |
|
205 <a NAME="SafeBrowsingUrl.pathPermutations" ID="SafeBrowsingUrl.pathPermutations"></a> |
|
206 <h4>SafeBrowsingUrl.pathPermutations</h4> |
|
207 <b>pathPermutations</b>(<i></i>) |
|
208 |
|
209 <p> |
|
210 Method to generate the permutations of the path. |
|
211 </p> |
|
212 <dl> |
|
213 |
|
214 <dt><i>path</i> (str)</dt> |
|
215 <dd> |
|
216 path to be processed |
|
217 </dd> |
|
218 </dl> |
|
219 <dl> |
|
220 <dt>Yield:</dt> |
|
221 <dd> |
|
222 permutated paths |
|
223 </dd> |
|
224 </dl> |
|
225 <dl> |
|
226 <dt>Yield Type:</dt> |
|
227 <dd> |
|
228 str |
|
229 </dd> |
|
230 </dl> |
|
231 <a NAME="SafeBrowsingUrl.quote" ID="SafeBrowsingUrl.quote"></a> |
|
232 <h4>SafeBrowsingUrl.quote</h4> |
|
233 <b>quote</b>(<i></i>) |
|
234 |
|
235 <p> |
|
236 Method to quote a string. |
|
237 </p> |
|
238 <dl> |
|
239 |
|
240 <dt><i>string</i> (str)</dt> |
|
241 <dd> |
|
242 to be quoted |
|
243 </dd> |
|
244 </dl> |
|
245 <dl> |
|
246 <dt>Return:</dt> |
|
247 <dd> |
|
248 quoted string |
|
249 </dd> |
|
250 </dl> |
|
251 <dl> |
|
252 <dt>Return Type:</dt> |
|
253 <dd> |
|
254 str |
|
255 </dd> |
|
256 </dl> |
|
257 <a NAME="SafeBrowsingUrl.digest" ID="SafeBrowsingUrl.digest"></a> |
|
258 <h4>SafeBrowsingUrl.digest (static)</h4> |
|
259 <b>digest</b>(<i></i>) |
|
260 |
|
261 <p> |
|
262 Static method to calculate the SHA256 digest of an URL string. |
|
263 </p> |
|
264 <dl> |
|
265 |
|
266 <dt><i>url</i> (str)</dt> |
|
267 <dd> |
|
268 URL string |
|
269 </dd> |
|
270 </dl> |
|
271 <dl> |
|
272 <dt>Return:</dt> |
|
273 <dd> |
|
274 SHA256 digest of the URL string |
|
275 </dd> |
|
276 </dl> |
|
277 <dl> |
|
278 <dt>Return Type:</dt> |
|
279 <dd> |
|
280 bytes |
|
281 </dd> |
|
282 </dl> |
|
283 <a NAME="SafeBrowsingUrl.permutations" ID="SafeBrowsingUrl.permutations"></a> |
|
284 <h4>SafeBrowsingUrl.permutations (static)</h4> |
|
285 <b>permutations</b>(<i></i>) |
|
286 |
|
287 <p> |
|
288 Static method to determine all permutations of host name and path |
|
289 which can be applied to blacklisted URLs. |
|
290 </p> |
|
291 <dl> |
|
292 |
|
293 <dt><i>url</i> (str)</dt> |
|
294 <dd> |
|
295 URL string to be permuted |
|
296 </dd> |
|
297 </dl> |
|
298 <dl> |
|
299 <dt>Yield:</dt> |
|
300 <dd> |
|
301 permutated URL strings |
|
302 </dd> |
|
303 </dl> |
|
304 <dl> |
|
305 <dt>Yield Type:</dt> |
|
306 <dd> |
|
307 str |
|
308 </dd> |
|
309 </dl> |
|
310 <div align="right"><a href="#top">Up</a></div> |
|
311 <hr /> |
|
312 </body></html> |