|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.WebBrowser.GreaseMonkey.GreaseMonkeyManager</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.GreaseMonkey.GreaseMonkeyManager</h1> |
|
23 <p> |
|
24 Module implementing the manager for GreaseMonkey scripts. |
|
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="#GreaseMonkeyManager">GreaseMonkeyManager</a></td> |
|
34 <td>Class implementing the manager for GreaseMonkey scripts.</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="GreaseMonkeyManager" ID="GreaseMonkeyManager"></a> |
|
43 <h2>GreaseMonkeyManager</h2> |
|
44 <p> |
|
45 Class implementing the manager for GreaseMonkey scripts. |
|
46 </p><h3>Signals</h3> |
|
47 <dl> |
|
48 <dt>scriptsChanged()</dt> |
|
49 <dd> |
|
50 emitted to indicate a change of scripts |
|
51 </dd> |
|
52 </dl> |
|
53 <h3>Derived from</h3> |
|
54 QObject |
|
55 <h3>Class Attributes</h3> |
|
56 <table> |
|
57 <tr><td>None</td></tr> |
|
58 </table> |
|
59 <h3>Class Methods</h3> |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Methods</h3> |
|
64 <table> |
|
65 <tr> |
|
66 <td><a href="#GreaseMonkeyManager.__init__">GreaseMonkeyManager</a></td> |
|
67 <td>Constructor</td> |
|
68 </tr><tr> |
|
69 <td><a href="#GreaseMonkeyManager.__downloaderFinished">__downloaderFinished</a></td> |
|
70 <td>Private slot to handle the completion of a script download.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#GreaseMonkeyManager.__load">__load</a></td> |
|
73 <td>Private slot to load the available scripts into the manager.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#GreaseMonkeyManager.__scriptChanged">__scriptChanged</a></td> |
|
76 <td>Private slot handling a changed script.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#GreaseMonkeyManager.addScript">addScript</a></td> |
|
79 <td>Public method to add a script.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#GreaseMonkeyManager.allScripts">allScripts</a></td> |
|
82 <td>Public method to get a list of all scripts.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#GreaseMonkeyManager.canRunOnScheme">canRunOnScheme</a></td> |
|
85 <td>Public method to check, if scripts can be run on a scheme.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#GreaseMonkeyManager.containsScript">containsScript</a></td> |
|
88 <td>Public method to check, if the given script exists.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#GreaseMonkeyManager.disableScript">disableScript</a></td> |
|
91 <td>Public method to disable the given script.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#GreaseMonkeyManager.doDownloadScript">doDownloadScript</a></td> |
|
94 <td>Public slot to download a GreaseMonkey script.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#GreaseMonkeyManager.downloadScript">downloadScript</a></td> |
|
97 <td>Public method to download a GreaseMonkey script.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#GreaseMonkeyManager.enableScript">enableScript</a></td> |
|
100 <td>Public method to enable the given script.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#GreaseMonkeyManager.removeScript">removeScript</a></td> |
|
103 <td>Public method to remove a script.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#GreaseMonkeyManager.requireScripts">requireScripts</a></td> |
|
106 <td>Public method to get the sources of all required scripts.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#GreaseMonkeyManager.requireScriptsDirectory">requireScriptsDirectory</a></td> |
|
109 <td>Public method to get the path of the scripts directory.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#GreaseMonkeyManager.saveConfiguration">saveConfiguration</a></td> |
|
112 <td>Public method to save the configuration.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#GreaseMonkeyManager.scriptsDirectory">scriptsDirectory</a></td> |
|
115 <td>Public method to get the path of the scripts directory.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#GreaseMonkeyManager.showConfigurationDialog">showConfigurationDialog</a></td> |
|
118 <td>Public method to show the configuration dialog.</td> |
|
119 </tr> |
|
120 </table> |
|
121 <h3>Static Methods</h3> |
|
122 <table> |
|
123 <tr><td>None</td></tr> |
|
124 </table> |
|
125 <a NAME="GreaseMonkeyManager.__init__" ID="GreaseMonkeyManager.__init__"></a> |
|
126 <h4>GreaseMonkeyManager (Constructor)</h4> |
|
127 <b>GreaseMonkeyManager</b>(<i>parent=None</i>) |
|
128 <p> |
|
129 Constructor |
|
130 </p><dl> |
|
131 <dt><i>parent</i></dt> |
|
132 <dd> |
|
133 reference to the parent object (QObject) |
|
134 </dd> |
|
135 </dl><a NAME="GreaseMonkeyManager.__downloaderFinished" ID="GreaseMonkeyManager.__downloaderFinished"></a> |
|
136 <h4>GreaseMonkeyManager.__downloaderFinished</h4> |
|
137 <b>__downloaderFinished</b>(<i>fileName, downloader</i>) |
|
138 <p> |
|
139 Private slot to handle the completion of a script download. |
|
140 </p><dl> |
|
141 <dt><i>fileName</i> (str)</dt> |
|
142 <dd> |
|
143 name of the downloaded script |
|
144 </dd><dt><i>downloader</i> (GreaseMonkeyDownloader)</dt> |
|
145 <dd> |
|
146 reference to the downloader object |
|
147 </dd> |
|
148 </dl><a NAME="GreaseMonkeyManager.__load" ID="GreaseMonkeyManager.__load"></a> |
|
149 <h4>GreaseMonkeyManager.__load</h4> |
|
150 <b>__load</b>(<i></i>) |
|
151 <p> |
|
152 Private slot to load the available scripts into the manager. |
|
153 </p><a NAME="GreaseMonkeyManager.__scriptChanged" ID="GreaseMonkeyManager.__scriptChanged"></a> |
|
154 <h4>GreaseMonkeyManager.__scriptChanged</h4> |
|
155 <b>__scriptChanged</b>(<i>script</i>) |
|
156 <p> |
|
157 Private slot handling a changed script. |
|
158 </p><dl> |
|
159 <dt><i>script</i> (GreaseMonkeyScript)</dt> |
|
160 <dd> |
|
161 reference to the changed script |
|
162 </dd> |
|
163 </dl><a NAME="GreaseMonkeyManager.addScript" ID="GreaseMonkeyManager.addScript"></a> |
|
164 <h4>GreaseMonkeyManager.addScript</h4> |
|
165 <b>addScript</b>(<i>script</i>) |
|
166 <p> |
|
167 Public method to add a script. |
|
168 </p><dl> |
|
169 <dt><i>script</i></dt> |
|
170 <dd> |
|
171 script to be added (GreaseMonkeyScript) |
|
172 </dd> |
|
173 </dl><dl> |
|
174 <dt>Returns:</dt> |
|
175 <dd> |
|
176 flag indicating success (boolean) |
|
177 </dd> |
|
178 </dl><a NAME="GreaseMonkeyManager.allScripts" ID="GreaseMonkeyManager.allScripts"></a> |
|
179 <h4>GreaseMonkeyManager.allScripts</h4> |
|
180 <b>allScripts</b>(<i></i>) |
|
181 <p> |
|
182 Public method to get a list of all scripts. |
|
183 </p><dl> |
|
184 <dt>Returns:</dt> |
|
185 <dd> |
|
186 list of all scripts (list of GreaseMonkeyScript) |
|
187 </dd> |
|
188 </dl><a NAME="GreaseMonkeyManager.canRunOnScheme" ID="GreaseMonkeyManager.canRunOnScheme"></a> |
|
189 <h4>GreaseMonkeyManager.canRunOnScheme</h4> |
|
190 <b>canRunOnScheme</b>(<i>scheme</i>) |
|
191 <p> |
|
192 Public method to check, if scripts can be run on a scheme. |
|
193 </p><dl> |
|
194 <dt><i>scheme</i></dt> |
|
195 <dd> |
|
196 scheme to check (string) |
|
197 </dd> |
|
198 </dl><dl> |
|
199 <dt>Returns:</dt> |
|
200 <dd> |
|
201 flag indicating, that scripts can be run (boolean) |
|
202 </dd> |
|
203 </dl><a NAME="GreaseMonkeyManager.containsScript" ID="GreaseMonkeyManager.containsScript"></a> |
|
204 <h4>GreaseMonkeyManager.containsScript</h4> |
|
205 <b>containsScript</b>(<i>fullName</i>) |
|
206 <p> |
|
207 Public method to check, if the given script exists. |
|
208 </p><dl> |
|
209 <dt><i>fullName</i></dt> |
|
210 <dd> |
|
211 full name of the script (string) |
|
212 </dd> |
|
213 </dl><dl> |
|
214 <dt>Returns:</dt> |
|
215 <dd> |
|
216 flag indicating the existence (boolean) |
|
217 </dd> |
|
218 </dl><a NAME="GreaseMonkeyManager.disableScript" ID="GreaseMonkeyManager.disableScript"></a> |
|
219 <h4>GreaseMonkeyManager.disableScript</h4> |
|
220 <b>disableScript</b>(<i>script</i>) |
|
221 <p> |
|
222 Public method to disable the given script. |
|
223 </p><dl> |
|
224 <dt><i>script</i></dt> |
|
225 <dd> |
|
226 script to be disabled (GreaseMonkeyScript) |
|
227 </dd> |
|
228 </dl><a NAME="GreaseMonkeyManager.doDownloadScript" ID="GreaseMonkeyManager.doDownloadScript"></a> |
|
229 <h4>GreaseMonkeyManager.doDownloadScript</h4> |
|
230 <b>doDownloadScript</b>(<i>url</i>) |
|
231 <p> |
|
232 Public slot to download a GreaseMonkey script. |
|
233 </p><p> |
|
234 Note: The download needed to be separated in the invoking part |
|
235 (s.a.) and the one doing the real download because the invoking |
|
236 part runs in a different thread (i.e. the web engine thread). |
|
237 </p><dl> |
|
238 <dt><i>url</i> (QUrl)</dt> |
|
239 <dd> |
|
240 URL to download script from |
|
241 </dd> |
|
242 </dl><a NAME="GreaseMonkeyManager.downloadScript" ID="GreaseMonkeyManager.downloadScript"></a> |
|
243 <h4>GreaseMonkeyManager.downloadScript</h4> |
|
244 <b>downloadScript</b>(<i>url</i>) |
|
245 <p> |
|
246 Public method to download a GreaseMonkey script. |
|
247 </p><dl> |
|
248 <dt><i>url</i> (QUrl)</dt> |
|
249 <dd> |
|
250 URL to download script from |
|
251 </dd> |
|
252 </dl><a NAME="GreaseMonkeyManager.enableScript" ID="GreaseMonkeyManager.enableScript"></a> |
|
253 <h4>GreaseMonkeyManager.enableScript</h4> |
|
254 <b>enableScript</b>(<i>script</i>) |
|
255 <p> |
|
256 Public method to enable the given script. |
|
257 </p><dl> |
|
258 <dt><i>script</i></dt> |
|
259 <dd> |
|
260 script to be enabled (GreaseMonkeyScript) |
|
261 </dd> |
|
262 </dl><a NAME="GreaseMonkeyManager.removeScript" ID="GreaseMonkeyManager.removeScript"></a> |
|
263 <h4>GreaseMonkeyManager.removeScript</h4> |
|
264 <b>removeScript</b>(<i>script, removeFile=True</i>) |
|
265 <p> |
|
266 Public method to remove a script. |
|
267 </p><dl> |
|
268 <dt><i>script</i></dt> |
|
269 <dd> |
|
270 script to be removed (GreaseMonkeyScript) |
|
271 </dd><dt><i>removeFile</i></dt> |
|
272 <dd> |
|
273 flag indicating to remove the script file as well |
|
274 (bool) |
|
275 </dd> |
|
276 </dl><dl> |
|
277 <dt>Returns:</dt> |
|
278 <dd> |
|
279 flag indicating success (boolean) |
|
280 </dd> |
|
281 </dl><a NAME="GreaseMonkeyManager.requireScripts" ID="GreaseMonkeyManager.requireScripts"></a> |
|
282 <h4>GreaseMonkeyManager.requireScripts</h4> |
|
283 <b>requireScripts</b>(<i>urlList</i>) |
|
284 <p> |
|
285 Public method to get the sources of all required scripts. |
|
286 </p><dl> |
|
287 <dt><i>urlList</i></dt> |
|
288 <dd> |
|
289 list of URLs (list of string) |
|
290 </dd> |
|
291 </dl><dl> |
|
292 <dt>Returns:</dt> |
|
293 <dd> |
|
294 sources of all required scripts (string) |
|
295 </dd> |
|
296 </dl><a NAME="GreaseMonkeyManager.requireScriptsDirectory" ID="GreaseMonkeyManager.requireScriptsDirectory"></a> |
|
297 <h4>GreaseMonkeyManager.requireScriptsDirectory</h4> |
|
298 <b>requireScriptsDirectory</b>(<i></i>) |
|
299 <p> |
|
300 Public method to get the path of the scripts directory. |
|
301 </p><dl> |
|
302 <dt>Returns:</dt> |
|
303 <dd> |
|
304 path of the scripts directory (string) |
|
305 </dd> |
|
306 </dl><a NAME="GreaseMonkeyManager.saveConfiguration" ID="GreaseMonkeyManager.saveConfiguration"></a> |
|
307 <h4>GreaseMonkeyManager.saveConfiguration</h4> |
|
308 <b>saveConfiguration</b>(<i></i>) |
|
309 <p> |
|
310 Public method to save the configuration. |
|
311 </p><a NAME="GreaseMonkeyManager.scriptsDirectory" ID="GreaseMonkeyManager.scriptsDirectory"></a> |
|
312 <h4>GreaseMonkeyManager.scriptsDirectory</h4> |
|
313 <b>scriptsDirectory</b>(<i></i>) |
|
314 <p> |
|
315 Public method to get the path of the scripts directory. |
|
316 </p><dl> |
|
317 <dt>Returns:</dt> |
|
318 <dd> |
|
319 path of the scripts directory (string) |
|
320 </dd> |
|
321 </dl><a NAME="GreaseMonkeyManager.showConfigurationDialog" ID="GreaseMonkeyManager.showConfigurationDialog"></a> |
|
322 <h4>GreaseMonkeyManager.showConfigurationDialog</h4> |
|
323 <b>showConfigurationDialog</b>(<i>parent=None</i>) |
|
324 <p> |
|
325 Public method to show the configuration dialog. |
|
326 </p><dl> |
|
327 <dt><i>parent</i></dt> |
|
328 <dd> |
|
329 reference to the parent widget (QWidget) |
|
330 </dd> |
|
331 </dl> |
|
332 <div align="right"><a href="#top">Up</a></div> |
|
333 <hr /> |
|
334 </body></html> |