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