|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Toolbox.Startup</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.Toolbox.Startup</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing some startup helper funcions. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>application</td></tr><tr><td>loaded_translators</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 <tr><td>None</td></tr> |
|
23 </table> |
|
24 <h3>Functions</h3> |
|
25 |
|
26 <table> |
|
27 |
|
28 <tr> |
|
29 <td><a href="#getDefaultIconPaths">getDefaultIconPaths</a></td> |
|
30 <td>Module function to determine the default icon paths.</td> |
|
31 </tr> |
|
32 <tr> |
|
33 <td><a href="#handleArgs">handleArgs</a></td> |
|
34 <td>Module function to handle the always present commandline options.</td> |
|
35 </tr> |
|
36 <tr> |
|
37 <td><a href="#initializeResourceSearchPath">initializeResourceSearchPath</a></td> |
|
38 <td>Module function to initialize the default mime source factory.</td> |
|
39 </tr> |
|
40 <tr> |
|
41 <td><a href="#loadTranslatorForLocale">loadTranslatorForLocale</a></td> |
|
42 <td>Module function to find and load a specific translation.</td> |
|
43 </tr> |
|
44 <tr> |
|
45 <td><a href="#loadTranslators">loadTranslators</a></td> |
|
46 <td>Module function to load all required translations.</td> |
|
47 </tr> |
|
48 <tr> |
|
49 <td><a href="#setLibraryPaths">setLibraryPaths</a></td> |
|
50 <td>Module function to set the Qt library paths correctly.</td> |
|
51 </tr> |
|
52 <tr> |
|
53 <td><a href="#simpleAppStartup">simpleAppStartup</a></td> |
|
54 <td>Module function to start up an application that doesn't need a specialized start up.</td> |
|
55 </tr> |
|
56 <tr> |
|
57 <td><a href="#usage">usage</a></td> |
|
58 <td>Module function to show the usage information.</td> |
|
59 </tr> |
|
60 <tr> |
|
61 <td><a href="#version">version</a></td> |
|
62 <td>Module function to show the version information.</td> |
|
63 </tr> |
|
64 </table> |
|
65 <hr /> |
|
66 <hr /> |
|
67 <a NAME="getDefaultIconPaths" ID="getDefaultIconPaths"></a> |
|
68 <h2>getDefaultIconPaths</h2> |
|
69 <b>getDefaultIconPaths</b>(<i>application</i>) |
|
70 |
|
71 <p> |
|
72 Module function to determine the default icon paths. |
|
73 </p> |
|
74 <dl> |
|
75 |
|
76 <dt><i>application</i> (EricApplication)</dt> |
|
77 <dd> |
|
78 reference to the application object |
|
79 </dd> |
|
80 </dl> |
|
81 <dl> |
|
82 <dt>Return:</dt> |
|
83 <dd> |
|
84 list of default icon paths |
|
85 </dd> |
|
86 </dl> |
|
87 <dl> |
|
88 <dt>Return Type:</dt> |
|
89 <dd> |
|
90 list of str |
|
91 </dd> |
|
92 </dl> |
|
93 <div align="right"><a href="#top">Up</a></div> |
|
94 <hr /> |
|
95 <hr /> |
|
96 <a NAME="handleArgs" ID="handleArgs"></a> |
|
97 <h2>handleArgs</h2> |
|
98 <b>handleArgs</b>(<i>argv, appinfo</i>) |
|
99 |
|
100 <p> |
|
101 Module function to handle the always present commandline options. |
|
102 </p> |
|
103 <dl> |
|
104 |
|
105 <dt><i>argv</i></dt> |
|
106 <dd> |
|
107 list of commandline parameters (list of strings) |
|
108 </dd> |
|
109 <dt><i>appinfo</i></dt> |
|
110 <dd> |
|
111 dictionary describing the application |
|
112 </dd> |
|
113 </dl> |
|
114 <dl> |
|
115 <dt>Return:</dt> |
|
116 <dd> |
|
117 index of the '--' option (integer). This is used to tell |
|
118 the application, that all additional options don't belong to |
|
119 the application. |
|
120 </dd> |
|
121 </dl> |
|
122 <div align="right"><a href="#top">Up</a></div> |
|
123 <hr /> |
|
124 <hr /> |
|
125 <a NAME="initializeResourceSearchPath" ID="initializeResourceSearchPath"></a> |
|
126 <h2>initializeResourceSearchPath</h2> |
|
127 <b>initializeResourceSearchPath</b>(<i>application</i>) |
|
128 |
|
129 <p> |
|
130 Module function to initialize the default mime source factory. |
|
131 </p> |
|
132 <dl> |
|
133 |
|
134 <dt><i>application</i> (EricApplication)</dt> |
|
135 <dd> |
|
136 reference to the application object |
|
137 </dd> |
|
138 </dl> |
|
139 <div align="right"><a href="#top">Up</a></div> |
|
140 <hr /> |
|
141 <hr /> |
|
142 <a NAME="loadTranslatorForLocale" ID="loadTranslatorForLocale"></a> |
|
143 <h2>loadTranslatorForLocale</h2> |
|
144 <b>loadTranslatorForLocale</b>(<i>dirs, tn</i>) |
|
145 |
|
146 <p> |
|
147 Module function to find and load a specific translation. |
|
148 </p> |
|
149 <dl> |
|
150 |
|
151 <dt><i>dirs</i></dt> |
|
152 <dd> |
|
153 Searchpath for the translations. (list of strings) |
|
154 </dd> |
|
155 <dt><i>tn</i></dt> |
|
156 <dd> |
|
157 The translation to be loaded. (string) |
|
158 </dd> |
|
159 </dl> |
|
160 <dl> |
|
161 <dt>Return:</dt> |
|
162 <dd> |
|
163 Tuple of a status flag and the loaded translator |
|
164 (int, QTranslator) |
|
165 </dd> |
|
166 </dl> |
|
167 <div align="right"><a href="#top">Up</a></div> |
|
168 <hr /> |
|
169 <hr /> |
|
170 <a NAME="loadTranslators" ID="loadTranslators"></a> |
|
171 <h2>loadTranslators</h2> |
|
172 <b>loadTranslators</b>(<i>qtTransDir, app, translationFiles=()</i>) |
|
173 |
|
174 <p> |
|
175 Module function to load all required translations. |
|
176 </p> |
|
177 <dl> |
|
178 |
|
179 <dt><i>qtTransDir</i></dt> |
|
180 <dd> |
|
181 directory of the Qt translations files (string) |
|
182 </dd> |
|
183 <dt><i>app</i></dt> |
|
184 <dd> |
|
185 reference to the application object (QApplication) |
|
186 </dd> |
|
187 <dt><i>translationFiles</i></dt> |
|
188 <dd> |
|
189 tuple of additional translations to |
|
190 be loaded (tuple of strings) |
|
191 </dd> |
|
192 </dl> |
|
193 <dl> |
|
194 <dt>Return:</dt> |
|
195 <dd> |
|
196 the requested locale (string) |
|
197 </dd> |
|
198 </dl> |
|
199 <div align="right"><a href="#top">Up</a></div> |
|
200 <hr /> |
|
201 <hr /> |
|
202 <a NAME="setLibraryPaths" ID="setLibraryPaths"></a> |
|
203 <h2>setLibraryPaths</h2> |
|
204 <b>setLibraryPaths</b>(<i></i>) |
|
205 |
|
206 <p> |
|
207 Module function to set the Qt library paths correctly. |
|
208 </p> |
|
209 <div align="right"><a href="#top">Up</a></div> |
|
210 <hr /> |
|
211 <hr /> |
|
212 <a NAME="simpleAppStartup" ID="simpleAppStartup"></a> |
|
213 <h2>simpleAppStartup</h2> |
|
214 <b>simpleAppStartup</b>(<i>argv, appinfo, mwFactory, quitOnLastWindowClosed=True, app=None, raiseIt=True, installErrorHandler=False</i>) |
|
215 |
|
216 <p> |
|
217 Module function to start up an application that doesn't need a specialized |
|
218 start up. |
|
219 </p> |
|
220 <p> |
|
221 This function is used by all of eric's helper programs. |
|
222 </p> |
|
223 <dl> |
|
224 |
|
225 <dt><i>argv</i></dt> |
|
226 <dd> |
|
227 list of commandline parameters (list of strings) |
|
228 </dd> |
|
229 <dt><i>appinfo</i></dt> |
|
230 <dd> |
|
231 dictionary describing the application |
|
232 </dd> |
|
233 <dt><i>mwFactory</i></dt> |
|
234 <dd> |
|
235 factory function generating the main widget. This |
|
236 function must accept the following parameter. |
|
237 <dl> |
|
238 <dt>argv</dt> |
|
239 <dd>list of commandline parameters (list of strings)</dd> |
|
240 </dl> |
|
241 </dd> |
|
242 <dt><i>quitOnLastWindowClosed</i></dt> |
|
243 <dd> |
|
244 flag indicating to quit the application, |
|
245 if the last window was closed (boolean) |
|
246 </dd> |
|
247 <dt><i>app</i></dt> |
|
248 <dd> |
|
249 reference to the application object (QApplication or None) |
|
250 </dd> |
|
251 <dt><i>raiseIt</i></dt> |
|
252 <dd> |
|
253 flag indicating to raise the generated application |
|
254 window (boolean) |
|
255 </dd> |
|
256 <dt><i>installErrorHandler</i></dt> |
|
257 <dd> |
|
258 flag indicating to install an error |
|
259 handler dialog (boolean) |
|
260 </dd> |
|
261 </dl> |
|
262 <dl> |
|
263 <dt>Return:</dt> |
|
264 <dd> |
|
265 exit result (integer) |
|
266 </dd> |
|
267 </dl> |
|
268 <div align="right"><a href="#top">Up</a></div> |
|
269 <hr /> |
|
270 <hr /> |
|
271 <a NAME="usage" ID="usage"></a> |
|
272 <h2>usage</h2> |
|
273 <b>usage</b>(<i>appinfo, optlen=12</i>) |
|
274 |
|
275 <p> |
|
276 Module function to show the usage information. |
|
277 </p> |
|
278 <dl> |
|
279 |
|
280 <dt><i>appinfo</i></dt> |
|
281 <dd> |
|
282 dictionary describing the application |
|
283 </dd> |
|
284 <dt><i>optlen</i></dt> |
|
285 <dd> |
|
286 length of the field for the commandline option (integer) |
|
287 </dd> |
|
288 </dl> |
|
289 <div align="right"><a href="#top">Up</a></div> |
|
290 <hr /> |
|
291 <hr /> |
|
292 <a NAME="version" ID="version"></a> |
|
293 <h2>version</h2> |
|
294 <b>version</b>(<i>appinfo</i>) |
|
295 |
|
296 <p> |
|
297 Module function to show the version information. |
|
298 </p> |
|
299 <dl> |
|
300 |
|
301 <dt><i>appinfo</i></dt> |
|
302 <dd> |
|
303 dictionary describing the application |
|
304 </dd> |
|
305 </dl> |
|
306 <div align="right"><a href="#top">Up</a></div> |
|
307 <hr /> |
|
308 </body></html> |