|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Toolbox.Startup</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.Toolbox.Startup</h1> |
|
23 <p> |
|
24 Module implementing some startup helper funcions. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>application</td></tr><tr><td>loaded_translators</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <h3>Functions</h3> |
|
35 <table> |
|
36 <tr> |
|
37 <td><a href="#handleArgs">handleArgs</a></td> |
|
38 <td>Module function to handle the always present commandline options.</td> |
|
39 </tr><tr> |
|
40 <td><a href="#initializeResourceSearchPath">initializeResourceSearchPath</a></td> |
|
41 <td>Module function to initialize the default mime source factory.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#loadTranslatorForLocale">loadTranslatorForLocale</a></td> |
|
44 <td>Module function to find and load a specific translation.</td> |
|
45 </tr><tr> |
|
46 <td><a href="#loadTranslators">loadTranslators</a></td> |
|
47 <td>Module function to load all required translations.</td> |
|
48 </tr><tr> |
|
49 <td><a href="#setLibraryPaths">setLibraryPaths</a></td> |
|
50 <td>Module function to set the Qt library paths correctly for windows systems.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#simpleAppStartup">simpleAppStartup</a></td> |
|
53 <td>Module function to start up an application that doesn't need a specialized start up.</td> |
|
54 </tr><tr> |
|
55 <td><a href="#usage">usage</a></td> |
|
56 <td>Module function to show the usage information.</td> |
|
57 </tr><tr> |
|
58 <td><a href="#version">version</a></td> |
|
59 <td>Module function to show the version information.</td> |
|
60 </tr> |
|
61 </table> |
|
62 <hr /><hr /> |
|
63 <a NAME="handleArgs" ID="handleArgs"></a> |
|
64 <h2>handleArgs</h2> |
|
65 <b>handleArgs</b>(<i>argv, appinfo</i>) |
|
66 <p> |
|
67 Module function to handle the always present commandline options. |
|
68 </p><dl> |
|
69 <dt><i>argv</i></dt> |
|
70 <dd> |
|
71 list of commandline parameters (list of strings) |
|
72 </dd><dt><i>appinfo</i></dt> |
|
73 <dd> |
|
74 dictionary describing the application |
|
75 </dd> |
|
76 </dl><dl> |
|
77 <dt>Returns:</dt> |
|
78 <dd> |
|
79 index of the '--' option (integer). This is used to tell |
|
80 the application, that all additional options don't belong to |
|
81 the application. |
|
82 </dd> |
|
83 </dl> |
|
84 <div align="right"><a href="#top">Up</a></div> |
|
85 <hr /><hr /> |
|
86 <a NAME="initializeResourceSearchPath" ID="initializeResourceSearchPath"></a> |
|
87 <h2>initializeResourceSearchPath</h2> |
|
88 <b>initializeResourceSearchPath</b>(<i></i>) |
|
89 <p> |
|
90 Module function to initialize the default mime source factory. |
|
91 </p> |
|
92 <div align="right"><a href="#top">Up</a></div> |
|
93 <hr /><hr /> |
|
94 <a NAME="loadTranslatorForLocale" ID="loadTranslatorForLocale"></a> |
|
95 <h2>loadTranslatorForLocale</h2> |
|
96 <b>loadTranslatorForLocale</b>(<i>dirs, tn</i>) |
|
97 <p> |
|
98 Module function to find and load a specific translation. |
|
99 </p><dl> |
|
100 <dt><i>dirs</i></dt> |
|
101 <dd> |
|
102 Searchpath for the translations. (list of strings) |
|
103 </dd><dt><i>tn</i></dt> |
|
104 <dd> |
|
105 The translation to be loaded. (string) |
|
106 </dd> |
|
107 </dl><dl> |
|
108 <dt>Returns:</dt> |
|
109 <dd> |
|
110 Tuple of a status flag and the loaded translator |
|
111 (int, QTranslator) |
|
112 </dd> |
|
113 </dl> |
|
114 <div align="right"><a href="#top">Up</a></div> |
|
115 <hr /><hr /> |
|
116 <a NAME="loadTranslators" ID="loadTranslators"></a> |
|
117 <h2>loadTranslators</h2> |
|
118 <b>loadTranslators</b>(<i>qtTransDir, app, translationFiles=()</i>) |
|
119 <p> |
|
120 Module function to load all required translations. |
|
121 </p><dl> |
|
122 <dt><i>qtTransDir</i></dt> |
|
123 <dd> |
|
124 directory of the Qt translations files (string) |
|
125 </dd><dt><i>app</i></dt> |
|
126 <dd> |
|
127 reference to the application object (QApplication) |
|
128 </dd><dt><i>translationFiles</i></dt> |
|
129 <dd> |
|
130 tuple of additional translations to |
|
131 be loaded (tuple of strings) |
|
132 </dd> |
|
133 </dl><dl> |
|
134 <dt>Returns:</dt> |
|
135 <dd> |
|
136 the requested locale (string) |
|
137 </dd> |
|
138 </dl> |
|
139 <div align="right"><a href="#top">Up</a></div> |
|
140 <hr /><hr /> |
|
141 <a NAME="setLibraryPaths" ID="setLibraryPaths"></a> |
|
142 <h2>setLibraryPaths</h2> |
|
143 <b>setLibraryPaths</b>(<i></i>) |
|
144 <p> |
|
145 Module function to set the Qt library paths correctly for windows systems. |
|
146 </p> |
|
147 <div align="right"><a href="#top">Up</a></div> |
|
148 <hr /><hr /> |
|
149 <a NAME="simpleAppStartup" ID="simpleAppStartup"></a> |
|
150 <h2>simpleAppStartup</h2> |
|
151 <b>simpleAppStartup</b>(<i>argv, appinfo, mwFactory, quitOnLastWindowClosed=True, app=None, raiseIt=True, installErrorHandler=False</i>) |
|
152 <p> |
|
153 Module function to start up an application that doesn't need a specialized |
|
154 start up. |
|
155 </p><p> |
|
156 This function is used by all of eric6's helper programs. |
|
157 </p><dl> |
|
158 <dt><i>argv</i></dt> |
|
159 <dd> |
|
160 list of commandline parameters (list of strings) |
|
161 </dd><dt><i>appinfo</i></dt> |
|
162 <dd> |
|
163 dictionary describing the application |
|
164 </dd><dt><i>mwFactory</i></dt> |
|
165 <dd> |
|
166 factory function generating the main widget. This |
|
167 function must accept the following parameter. |
|
168 <dl> |
|
169 <dt>argv</dt> |
|
170 <dd>list of commandline parameters (list of strings)</dd> |
|
171 </dl> |
|
172 </dd><dt><i>quitOnLastWindowClosed=</i></dt> |
|
173 <dd> |
|
174 flag indicating to quit the application, |
|
175 if the last window was closed (boolean) |
|
176 </dd><dt><i>app=</i></dt> |
|
177 <dd> |
|
178 reference to the application object (QApplication or None) |
|
179 </dd><dt><i>raiseIt=</i></dt> |
|
180 <dd> |
|
181 flag indicating to raise the generated application |
|
182 window (boolean) |
|
183 </dd><dt><i>installErrorHandler=</i></dt> |
|
184 <dd> |
|
185 flag indicating to install an error |
|
186 handler dialog (boolean) |
|
187 </dd> |
|
188 </dl><dl> |
|
189 <dt>Returns:</dt> |
|
190 <dd> |
|
191 exit result (integer) |
|
192 </dd> |
|
193 </dl> |
|
194 <div align="right"><a href="#top">Up</a></div> |
|
195 <hr /><hr /> |
|
196 <a NAME="usage" ID="usage"></a> |
|
197 <h2>usage</h2> |
|
198 <b>usage</b>(<i>appinfo, optlen=12</i>) |
|
199 <p> |
|
200 Module function to show the usage information. |
|
201 </p><dl> |
|
202 <dt><i>appinfo</i></dt> |
|
203 <dd> |
|
204 dictionary describing the application |
|
205 </dd><dt><i>optlen</i></dt> |
|
206 <dd> |
|
207 length of the field for the commandline option (integer) |
|
208 </dd> |
|
209 </dl> |
|
210 <div align="right"><a href="#top">Up</a></div> |
|
211 <hr /><hr /> |
|
212 <a NAME="version" ID="version"></a> |
|
213 <h2>version</h2> |
|
214 <b>version</b>(<i>appinfo</i>) |
|
215 <p> |
|
216 Module function to show the version information. |
|
217 </p><dl> |
|
218 <dt><i>appinfo</i></dt> |
|
219 <dd> |
|
220 dictionary describing the application |
|
221 </dd> |
|
222 </dl> |
|
223 <div align="right"><a href="#top">Up</a></div> |
|
224 <hr /> |
|
225 </body></html> |