|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>Plugin_Project_Flask.PluginProjectFlask</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>Plugin_Project_Flask.PluginProjectFlask</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the Flask project plugin. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>author</td></tr><tr><td>autoactivate</td></tr><tr><td>className</td></tr><tr><td>deactivateable</td></tr><tr><td>error</td></tr><tr><td>flaskPluginObject</td></tr><tr><td>longDescription</td></tr><tr><td>name</td></tr><tr><td>needsRestart</td></tr><tr><td>packageName</td></tr><tr><td>pyqtApi</td></tr><tr><td>shortDescription</td></tr><tr><td>version</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#ProjectFlaskPlugin">ProjectFlaskPlugin</a></td> |
|
39 <td>Class implementing the Flask project plugin.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 |
|
46 <tr> |
|
47 <td><a href="#apiFiles">apiFiles</a></td> |
|
48 <td>Module function to return the API files made available by this plugin.</td> |
|
49 </tr> |
|
50 <tr> |
|
51 <td><a href="#createFlaskPage">createFlaskPage</a></td> |
|
52 <td>Module function to create the Flask configuration page.</td> |
|
53 </tr> |
|
54 <tr> |
|
55 <td><a href="#getConfigData">getConfigData</a></td> |
|
56 <td>Module function returning data as required by the configuration dialog.</td> |
|
57 </tr> |
|
58 <tr> |
|
59 <td><a href="#prepareUninstall">prepareUninstall</a></td> |
|
60 <td>Module function to prepare for an uninstallation.</td> |
|
61 </tr> |
|
62 </table> |
|
63 <hr /> |
|
64 <hr /> |
|
65 <a NAME="ProjectFlaskPlugin" ID="ProjectFlaskPlugin"></a> |
|
66 <h2>ProjectFlaskPlugin</h2> |
|
67 |
|
68 <p> |
|
69 Class implementing the Flask project plugin. |
|
70 </p> |
|
71 <h3>Derived from</h3> |
|
72 QObject |
|
73 <h3>Class Attributes</h3> |
|
74 |
|
75 <table> |
|
76 <tr><td>PreferencesKey</td></tr><tr><td>lexerAssociations</td></tr> |
|
77 </table> |
|
78 <h3>Class Methods</h3> |
|
79 |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 <h3>Methods</h3> |
|
84 |
|
85 <table> |
|
86 |
|
87 <tr> |
|
88 <td><a href="#ProjectFlaskPlugin.__init__">ProjectFlaskPlugin</a></td> |
|
89 <td>Constructor</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#ProjectFlaskPlugin.__initialize">__initialize</a></td> |
|
93 <td>Private slot to (re)initialize the plugin.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#ProjectFlaskPlugin.__loadTranslator">__loadTranslator</a></td> |
|
97 <td>Private method to load the translation file.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#ProjectFlaskPlugin.__projectClosed">__projectClosed</a></td> |
|
101 <td>Private slot to handle the projectClosed signal.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#ProjectFlaskPlugin.__projectOpened">__projectOpened</a></td> |
|
105 <td>Private slot to handle the projectOpened signal.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#ProjectFlaskPlugin.__reregisterProjectType">__reregisterProjectType</a></td> |
|
109 <td>Private method to re-register the project type.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#ProjectFlaskPlugin.activate">activate</a></td> |
|
113 <td>Public method to activate this plugin.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#ProjectFlaskPlugin.binaryTranslationsCallback">binaryTranslationsCallback</a></td> |
|
117 <td>Public method to determine the filename of a compiled translation file given the translation source file.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#ProjectFlaskPlugin.deactivate">deactivate</a></td> |
|
121 <td>Public method to deactivate this plugin.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#ProjectFlaskPlugin.fileTypesCallback">fileTypesCallback</a></td> |
|
125 <td>Public method get the filetype associations of the Django project type.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#ProjectFlaskPlugin.getDefaultPreference">getDefaultPreference</a></td> |
|
129 <td>Public method to get the default value for a setting.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#ProjectFlaskPlugin.getMenu">getMenu</a></td> |
|
133 <td>Public method to get a reference to the requested menu.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#ProjectFlaskPlugin.getMenuNames">getMenuNames</a></td> |
|
137 <td>Public method to get the names of all menus.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#ProjectFlaskPlugin.getPreferences">getPreferences</a></td> |
|
141 <td>Public method to retrieve the various settings.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#ProjectFlaskPlugin.lexerAssociationCallback">lexerAssociationCallback</a></td> |
|
145 <td>Public method to get the lexer association of the Django project type for a file.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#ProjectFlaskPlugin.setPreferences">setPreferences</a></td> |
|
149 <td>Public method to store the various settings.</td> |
|
150 </tr> |
|
151 </table> |
|
152 <h3>Static Methods</h3> |
|
153 |
|
154 <table> |
|
155 <tr><td>None</td></tr> |
|
156 </table> |
|
157 |
|
158 <a NAME="ProjectFlaskPlugin.__init__" ID="ProjectFlaskPlugin.__init__"></a> |
|
159 <h4>ProjectFlaskPlugin (Constructor)</h4> |
|
160 <b>ProjectFlaskPlugin</b>(<i>ui</i>) |
|
161 |
|
162 <p> |
|
163 Constructor |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>ui</i> (UI.UserInterface)</dt> |
|
168 <dd> |
|
169 reference to the user interface object |
|
170 </dd> |
|
171 </dl> |
|
172 <a NAME="ProjectFlaskPlugin.__initialize" ID="ProjectFlaskPlugin.__initialize"></a> |
|
173 <h4>ProjectFlaskPlugin.__initialize</h4> |
|
174 <b>__initialize</b>(<i></i>) |
|
175 |
|
176 <p> |
|
177 Private slot to (re)initialize the plugin. |
|
178 </p> |
|
179 <a NAME="ProjectFlaskPlugin.__loadTranslator" ID="ProjectFlaskPlugin.__loadTranslator"></a> |
|
180 <h4>ProjectFlaskPlugin.__loadTranslator</h4> |
|
181 <b>__loadTranslator</b>(<i></i>) |
|
182 |
|
183 <p> |
|
184 Private method to load the translation file. |
|
185 </p> |
|
186 <a NAME="ProjectFlaskPlugin.__projectClosed" ID="ProjectFlaskPlugin.__projectClosed"></a> |
|
187 <h4>ProjectFlaskPlugin.__projectClosed</h4> |
|
188 <b>__projectClosed</b>(<i></i>) |
|
189 |
|
190 <p> |
|
191 Private slot to handle the projectClosed signal. |
|
192 </p> |
|
193 <a NAME="ProjectFlaskPlugin.__projectOpened" ID="ProjectFlaskPlugin.__projectOpened"></a> |
|
194 <h4>ProjectFlaskPlugin.__projectOpened</h4> |
|
195 <b>__projectOpened</b>(<i></i>) |
|
196 |
|
197 <p> |
|
198 Private slot to handle the projectOpened signal. |
|
199 </p> |
|
200 <a NAME="ProjectFlaskPlugin.__reregisterProjectType" ID="ProjectFlaskPlugin.__reregisterProjectType"></a> |
|
201 <h4>ProjectFlaskPlugin.__reregisterProjectType</h4> |
|
202 <b>__reregisterProjectType</b>(<i></i>) |
|
203 |
|
204 <p> |
|
205 Private method to re-register the project type. |
|
206 </p> |
|
207 <a NAME="ProjectFlaskPlugin.activate" ID="ProjectFlaskPlugin.activate"></a> |
|
208 <h4>ProjectFlaskPlugin.activate</h4> |
|
209 <b>activate</b>(<i></i>) |
|
210 |
|
211 <p> |
|
212 Public method to activate this plugin. |
|
213 </p> |
|
214 <dl> |
|
215 <dt>Returns:</dt> |
|
216 <dd> |
|
217 tuple of None and activation status |
|
218 </dd> |
|
219 </dl> |
|
220 <dl> |
|
221 <dt>Return Type:</dt> |
|
222 <dd> |
|
223 bool |
|
224 </dd> |
|
225 </dl> |
|
226 <a NAME="ProjectFlaskPlugin.binaryTranslationsCallback" ID="ProjectFlaskPlugin.binaryTranslationsCallback"></a> |
|
227 <h4>ProjectFlaskPlugin.binaryTranslationsCallback</h4> |
|
228 <b>binaryTranslationsCallback</b>(<i>filename</i>) |
|
229 |
|
230 <p> |
|
231 Public method to determine the filename of a compiled translation file |
|
232 given the translation source file. |
|
233 </p> |
|
234 <dl> |
|
235 |
|
236 <dt><i>filename</i> (str)</dt> |
|
237 <dd> |
|
238 name of the translation source file |
|
239 </dd> |
|
240 </dl> |
|
241 <dl> |
|
242 <dt>Returns:</dt> |
|
243 <dd> |
|
244 name of the binary translation file |
|
245 </dd> |
|
246 </dl> |
|
247 <dl> |
|
248 <dt>Return Type:</dt> |
|
249 <dd> |
|
250 str |
|
251 </dd> |
|
252 </dl> |
|
253 <a NAME="ProjectFlaskPlugin.deactivate" ID="ProjectFlaskPlugin.deactivate"></a> |
|
254 <h4>ProjectFlaskPlugin.deactivate</h4> |
|
255 <b>deactivate</b>(<i></i>) |
|
256 |
|
257 <p> |
|
258 Public method to deactivate this plugin. |
|
259 </p> |
|
260 <a NAME="ProjectFlaskPlugin.fileTypesCallback" ID="ProjectFlaskPlugin.fileTypesCallback"></a> |
|
261 <h4>ProjectFlaskPlugin.fileTypesCallback</h4> |
|
262 <b>fileTypesCallback</b>(<i></i>) |
|
263 |
|
264 <p> |
|
265 Public method get the filetype associations of the Django project type. |
|
266 </p> |
|
267 <dl> |
|
268 <dt>Returns:</dt> |
|
269 <dd> |
|
270 dictionary with file type associations |
|
271 </dd> |
|
272 </dl> |
|
273 <dl> |
|
274 <dt>Return Type:</dt> |
|
275 <dd> |
|
276 dict |
|
277 </dd> |
|
278 </dl> |
|
279 <a NAME="ProjectFlaskPlugin.getDefaultPreference" ID="ProjectFlaskPlugin.getDefaultPreference"></a> |
|
280 <h4>ProjectFlaskPlugin.getDefaultPreference</h4> |
|
281 <b>getDefaultPreference</b>(<i>key</i>) |
|
282 |
|
283 <p> |
|
284 Public method to get the default value for a setting. |
|
285 </p> |
|
286 <dl> |
|
287 |
|
288 <dt><i>key</i> (str)</dt> |
|
289 <dd> |
|
290 the key of the value to get |
|
291 </dd> |
|
292 </dl> |
|
293 <dl> |
|
294 <dt>Returns:</dt> |
|
295 <dd> |
|
296 the requested setting |
|
297 </dd> |
|
298 </dl> |
|
299 <dl> |
|
300 <dt>Return Type:</dt> |
|
301 <dd> |
|
302 any |
|
303 </dd> |
|
304 </dl> |
|
305 <a NAME="ProjectFlaskPlugin.getMenu" ID="ProjectFlaskPlugin.getMenu"></a> |
|
306 <h4>ProjectFlaskPlugin.getMenu</h4> |
|
307 <b>getMenu</b>(<i>name</i>) |
|
308 |
|
309 <p> |
|
310 Public method to get a reference to the requested menu. |
|
311 </p> |
|
312 <dl> |
|
313 |
|
314 <dt><i>name</i> (str)</dt> |
|
315 <dd> |
|
316 name of the menu |
|
317 </dd> |
|
318 </dl> |
|
319 <dl> |
|
320 <dt>Returns:</dt> |
|
321 <dd> |
|
322 reference to the menu or None, if no |
|
323 menu with the given name exists |
|
324 </dd> |
|
325 </dl> |
|
326 <dl> |
|
327 <dt>Return Type:</dt> |
|
328 <dd> |
|
329 QMenu or None |
|
330 </dd> |
|
331 </dl> |
|
332 <a NAME="ProjectFlaskPlugin.getMenuNames" ID="ProjectFlaskPlugin.getMenuNames"></a> |
|
333 <h4>ProjectFlaskPlugin.getMenuNames</h4> |
|
334 <b>getMenuNames</b>(<i></i>) |
|
335 |
|
336 <p> |
|
337 Public method to get the names of all menus. |
|
338 </p> |
|
339 <dl> |
|
340 <dt>Returns:</dt> |
|
341 <dd> |
|
342 menu names |
|
343 </dd> |
|
344 </dl> |
|
345 <dl> |
|
346 <dt>Return Type:</dt> |
|
347 <dd> |
|
348 list of str |
|
349 </dd> |
|
350 </dl> |
|
351 <a NAME="ProjectFlaskPlugin.getPreferences" ID="ProjectFlaskPlugin.getPreferences"></a> |
|
352 <h4>ProjectFlaskPlugin.getPreferences</h4> |
|
353 <b>getPreferences</b>(<i>key</i>) |
|
354 |
|
355 <p> |
|
356 Public method to retrieve the various settings. |
|
357 </p> |
|
358 <dl> |
|
359 |
|
360 <dt><i>key</i> (str)</dt> |
|
361 <dd> |
|
362 the key of the value to get |
|
363 </dd> |
|
364 </dl> |
|
365 <dl> |
|
366 <dt>Returns:</dt> |
|
367 <dd> |
|
368 the requested setting |
|
369 </dd> |
|
370 </dl> |
|
371 <dl> |
|
372 <dt>Return Type:</dt> |
|
373 <dd> |
|
374 any |
|
375 </dd> |
|
376 </dl> |
|
377 <a NAME="ProjectFlaskPlugin.lexerAssociationCallback" ID="ProjectFlaskPlugin.lexerAssociationCallback"></a> |
|
378 <h4>ProjectFlaskPlugin.lexerAssociationCallback</h4> |
|
379 <b>lexerAssociationCallback</b>(<i>filename</i>) |
|
380 |
|
381 <p> |
|
382 Public method to get the lexer association of the Django project type |
|
383 for a file. |
|
384 </p> |
|
385 <dl> |
|
386 |
|
387 <dt><i>filename</i> (str)</dt> |
|
388 <dd> |
|
389 name of the file |
|
390 </dd> |
|
391 </dl> |
|
392 <dl> |
|
393 <dt>Returns:</dt> |
|
394 <dd> |
|
395 name of the lexer (Pygments lexers are prefixed with |
|
396 'Pygments|') |
|
397 </dd> |
|
398 </dl> |
|
399 <dl> |
|
400 <dt>Return Type:</dt> |
|
401 <dd> |
|
402 str |
|
403 </dd> |
|
404 </dl> |
|
405 <a NAME="ProjectFlaskPlugin.setPreferences" ID="ProjectFlaskPlugin.setPreferences"></a> |
|
406 <h4>ProjectFlaskPlugin.setPreferences</h4> |
|
407 <b>setPreferences</b>(<i>key, value</i>) |
|
408 |
|
409 <p> |
|
410 Public method to store the various settings. |
|
411 </p> |
|
412 <dl> |
|
413 |
|
414 <dt><i>key</i> (str)</dt> |
|
415 <dd> |
|
416 the key of the setting to be set |
|
417 </dd> |
|
418 <dt><i>value</i> (any)</dt> |
|
419 <dd> |
|
420 the value to be set |
|
421 </dd> |
|
422 </dl> |
|
423 <div align="right"><a href="#top">Up</a></div> |
|
424 <hr /> |
|
425 <hr /> |
|
426 <a NAME="apiFiles" ID="apiFiles"></a> |
|
427 <h2>apiFiles</h2> |
|
428 <b>apiFiles</b>(<i>language</i>) |
|
429 |
|
430 <p> |
|
431 Module function to return the API files made available by this plugin. |
|
432 </p> |
|
433 <dl> |
|
434 |
|
435 <dt><i>language</i></dt> |
|
436 <dd> |
|
437 language to get APIs for (string) |
|
438 </dd> |
|
439 </dl> |
|
440 <dl> |
|
441 <dt>Returns:</dt> |
|
442 <dd> |
|
443 list of API filenames (list of string) |
|
444 </dd> |
|
445 </dl> |
|
446 <div align="right"><a href="#top">Up</a></div> |
|
447 <hr /> |
|
448 <hr /> |
|
449 <a NAME="createFlaskPage" ID="createFlaskPage"></a> |
|
450 <h2>createFlaskPage</h2> |
|
451 <b>createFlaskPage</b>(<i>configDlg</i>) |
|
452 |
|
453 <p> |
|
454 Module function to create the Flask configuration page. |
|
455 </p> |
|
456 <dl> |
|
457 |
|
458 <dt><i>configDlg</i></dt> |
|
459 <dd> |
|
460 reference to the configuration dialog |
|
461 </dd> |
|
462 </dl> |
|
463 <dl> |
|
464 <dt>Returns:</dt> |
|
465 <dd> |
|
466 reference to the configuration page |
|
467 </dd> |
|
468 </dl> |
|
469 <div align="right"><a href="#top">Up</a></div> |
|
470 <hr /> |
|
471 <hr /> |
|
472 <a NAME="getConfigData" ID="getConfigData"></a> |
|
473 <h2>getConfigData</h2> |
|
474 <b>getConfigData</b>(<i></i>) |
|
475 |
|
476 <p> |
|
477 Module function returning data as required by the configuration dialog. |
|
478 </p> |
|
479 <dl> |
|
480 <dt>Returns:</dt> |
|
481 <dd> |
|
482 dictionary containing the relevant data |
|
483 </dd> |
|
484 </dl> |
|
485 <dl> |
|
486 <dt>Return Type:</dt> |
|
487 <dd> |
|
488 dict |
|
489 </dd> |
|
490 </dl> |
|
491 <div align="right"><a href="#top">Up</a></div> |
|
492 <hr /> |
|
493 <hr /> |
|
494 <a NAME="prepareUninstall" ID="prepareUninstall"></a> |
|
495 <h2>prepareUninstall</h2> |
|
496 <b>prepareUninstall</b>(<i></i>) |
|
497 |
|
498 <p> |
|
499 Module function to prepare for an uninstallation. |
|
500 </p> |
|
501 <div align="right"><a href="#top">Up</a></div> |
|
502 <hr /> |
|
503 </body></html> |