87 ############################## |
87 ############################## |
88 ## start actions below ## |
88 ## start actions below ## |
89 ############################## |
89 ############################## |
90 |
90 |
91 self.startProjectAct = E5Action(self.trUtf8('Start Project'), |
91 self.startProjectAct = E5Action(self.trUtf8('Start Project'), |
92 self.trUtf8('Start &Project'), |
92 self.trUtf8('Start &Project'), |
93 0, 0, |
93 0, 0, |
94 self,'django_start_project') |
94 self, 'django_start_project') |
95 self.startProjectAct.setStatusTip(self.trUtf8( |
95 self.startProjectAct.setStatusTip(self.trUtf8( |
96 'Starts a new Django project')) |
96 'Starts a new Django project')) |
97 self.startProjectAct.setWhatsThis(self.trUtf8( |
97 self.startProjectAct.setWhatsThis(self.trUtf8( |
98 """<b>Start Project</b>""" |
98 """<b>Start Project</b>""" |
99 """<p>Starts a new Django project using "django-admin.py startproject".</p>""" |
99 """<p>Starts a new Django project using "django-admin.py startproject".</p>""" |
101 self.startProjectAct.triggered[()].connect(self.__startProject) |
101 self.startProjectAct.triggered[()].connect(self.__startProject) |
102 self.actions.append(self.startProjectAct) |
102 self.actions.append(self.startProjectAct) |
103 |
103 |
104 self.startGlobalApplicationAct = E5Action( |
104 self.startGlobalApplicationAct = E5Action( |
105 self.trUtf8('Start Application (global)'), |
105 self.trUtf8('Start Application (global)'), |
106 self.trUtf8('Start Application (&global)'), |
106 self.trUtf8('Start Application (&global)'), |
107 0, 0, |
107 0, 0, |
108 self,'django_start_global_application') |
108 self, 'django_start_global_application') |
109 self.startGlobalApplicationAct.setStatusTip(self.trUtf8( |
109 self.startGlobalApplicationAct.setStatusTip(self.trUtf8( |
110 'Starts a new global Django application')) |
110 'Starts a new global Django application')) |
111 self.startGlobalApplicationAct.setWhatsThis(self.trUtf8( |
111 self.startGlobalApplicationAct.setWhatsThis(self.trUtf8( |
112 """<b>Start Application (global)</b>""" |
112 """<b>Start Application (global)</b>""" |
113 """<p>Starts a new global Django application using""" |
113 """<p>Starts a new global Django application using""" |
117 self.__startGlobalApplication) |
117 self.__startGlobalApplication) |
118 self.actions.append(self.startGlobalApplicationAct) |
118 self.actions.append(self.startGlobalApplicationAct) |
119 |
119 |
120 self.startLocalApplicationAct = E5Action( |
120 self.startLocalApplicationAct = E5Action( |
121 self.trUtf8('Start Application (local)'), |
121 self.trUtf8('Start Application (local)'), |
122 self.trUtf8('Start Application (&local)'), |
122 self.trUtf8('Start Application (&local)'), |
123 0, 0, |
123 0, 0, |
124 self,'django_start_local_application') |
124 self, 'django_start_local_application') |
125 self.startLocalApplicationAct.setStatusTip(self.trUtf8( |
125 self.startLocalApplicationAct.setStatusTip(self.trUtf8( |
126 'Starts a new local Django application')) |
126 'Starts a new local Django application')) |
127 self.startLocalApplicationAct.setWhatsThis(self.trUtf8( |
127 self.startLocalApplicationAct.setWhatsThis(self.trUtf8( |
128 """<b>Start Application (local)</b>""" |
128 """<b>Start Application (local)</b>""" |
129 """<p>Starts a new local Django application using""" |
129 """<p>Starts a new local Django application using""" |
136 ############################## |
136 ############################## |
137 ## run actions below ## |
137 ## run actions below ## |
138 ############################## |
138 ############################## |
139 |
139 |
140 self.runServerAct = E5Action(self.trUtf8('Run Server'), |
140 self.runServerAct = E5Action(self.trUtf8('Run Server'), |
141 self.trUtf8('Run &Server'), |
141 self.trUtf8('Run &Server'), |
142 0, 0, |
142 0, 0, |
143 self,'django_run_server') |
143 self, 'django_run_server') |
144 self.runServerAct.setStatusTip(self.trUtf8( |
144 self.runServerAct.setStatusTip(self.trUtf8( |
145 'Starts the Django Web server')) |
145 'Starts the Django Web server')) |
146 self.runServerAct.setWhatsThis(self.trUtf8( |
146 self.runServerAct.setWhatsThis(self.trUtf8( |
147 """<b>Run Server</b>""" |
147 """<b>Run Server</b>""" |
148 """<p>Starts the Django Web server using "manage.py runserver".</p>""" |
148 """<p>Starts the Django Web server using "manage.py runserver".</p>""" |
149 )) |
149 )) |
150 self.runServerAct.triggered[()].connect(self.__runServer) |
150 self.runServerAct.triggered[()].connect(self.__runServer) |
151 self.actions.append(self.runServerAct) |
151 self.actions.append(self.runServerAct) |
152 |
152 |
153 self.runBrowserAct = E5Action(self.trUtf8('Run Web-Browser'), |
153 self.runBrowserAct = E5Action(self.trUtf8('Run Web-Browser'), |
154 self.trUtf8('Run &Web-Browser'), |
154 self.trUtf8('Run &Web-Browser'), |
155 0, 0, |
155 0, 0, |
156 self,'django_run_browser') |
156 self, 'django_run_browser') |
157 self.runBrowserAct.setStatusTip(self.trUtf8( |
157 self.runBrowserAct.setStatusTip(self.trUtf8( |
158 'Starts the default Web-Browser with the URL of the Django Web server')) |
158 'Starts the default Web-Browser with the URL of the Django Web server')) |
159 self.runBrowserAct.setWhatsThis(self.trUtf8( |
159 self.runBrowserAct.setWhatsThis(self.trUtf8( |
160 """<b>Run Web-Browser</b>""" |
160 """<b>Run Web-Browser</b>""" |
161 """<p>Starts the default Web-Browser with the URL of the """ |
161 """<p>Starts the default Web-Browser with the URL of the """ |
167 ############################## |
167 ############################## |
168 ## caching actions below ## |
168 ## caching actions below ## |
169 ############################## |
169 ############################## |
170 |
170 |
171 self.createCacheTableAct = E5Action(self.trUtf8('Create Cache Tables'), |
171 self.createCacheTableAct = E5Action(self.trUtf8('Create Cache Tables'), |
172 self.trUtf8('C&reate Cache Tables'), |
172 self.trUtf8('C&reate Cache Tables'), |
173 0, 0, |
173 0, 0, |
174 self,'django_create_cache_tables') |
174 self, 'django_create_cache_tables') |
175 self.createCacheTableAct.setStatusTip(self.trUtf8( |
175 self.createCacheTableAct.setStatusTip(self.trUtf8( |
176 'Creates the tables needed to use the SQL cache backend')) |
176 'Creates the tables needed to use the SQL cache backend')) |
177 self.createCacheTableAct.setWhatsThis(self.trUtf8( |
177 self.createCacheTableAct.setWhatsThis(self.trUtf8( |
178 """<b>Create Cache Tables</b>""" |
178 """<b>Create Cache Tables</b>""" |
179 """<p>Creates the tables needed to use the SQL cache backend.</p>""" |
179 """<p>Creates the tables needed to use the SQL cache backend.</p>""" |
184 ############################## |
184 ############################## |
185 ## help action below ## |
185 ## help action below ## |
186 ############################## |
186 ############################## |
187 |
187 |
188 self.helpAct = E5Action(self.trUtf8('Help'), |
188 self.helpAct = E5Action(self.trUtf8('Help'), |
189 self.trUtf8('&Help'), |
189 self.trUtf8('&Help'), |
190 0, 0, |
190 0, 0, |
191 self,'django_help') |
191 self, 'django_help') |
192 self.helpAct.setStatusTip(self.trUtf8( |
192 self.helpAct.setStatusTip(self.trUtf8( |
193 'Shows the Django help index')) |
193 'Shows the Django help index')) |
194 self.helpAct.setWhatsThis(self.trUtf8( |
194 self.helpAct.setWhatsThis(self.trUtf8( |
195 """<b>Help</b>""" |
195 """<b>Help</b>""" |
196 """<p>Shows the Django help index page.</p>""" |
196 """<p>Shows the Django help index page.</p>""" |
201 ############################## |
201 ############################## |
202 ## about action below ## |
202 ## about action below ## |
203 ############################## |
203 ############################## |
204 |
204 |
205 self.aboutDjangoAct = E5Action(self.trUtf8('About Django'), |
205 self.aboutDjangoAct = E5Action(self.trUtf8('About Django'), |
206 self.trUtf8('About D&jango'), |
206 self.trUtf8('About D&jango'), |
207 0, 0, |
207 0, 0, |
208 self,'django_about') |
208 self, 'django_about') |
209 self.aboutDjangoAct.setStatusTip(self.trUtf8( |
209 self.aboutDjangoAct.setStatusTip(self.trUtf8( |
210 'Shows some information about Django')) |
210 'Shows some information about Django')) |
211 self.aboutDjangoAct.setWhatsThis(self.trUtf8( |
211 self.aboutDjangoAct.setWhatsThis(self.trUtf8( |
212 """<b>About Django</b>""" |
212 """<b>About Django</b>""" |
213 """<p>Shows some information about Django.</p>""" |
213 """<p>Shows some information about Django.</p>""" |
225 def __initDatabaseActions(self): |
225 def __initDatabaseActions(self): |
226 """ |
226 """ |
227 Private method to define the database related actions. |
227 Private method to define the database related actions. |
228 """ |
228 """ |
229 self.syncDatabaseAct = E5Action(self.trUtf8('Synchronize'), |
229 self.syncDatabaseAct = E5Action(self.trUtf8('Synchronize'), |
230 self.trUtf8('&Synchronize'), |
230 self.trUtf8('&Synchronize'), |
231 0, 0, |
231 0, 0, |
232 self,'django_database_syncdb') |
232 self, 'django_database_syncdb') |
233 self.syncDatabaseAct.setStatusTip(self.trUtf8( |
233 self.syncDatabaseAct.setStatusTip(self.trUtf8( |
234 'Synchronizes the database')) |
234 'Synchronizes the database')) |
235 self.syncDatabaseAct.setWhatsThis(self.trUtf8( |
235 self.syncDatabaseAct.setWhatsThis(self.trUtf8( |
236 """<b>Synchronize</b>""" |
236 """<b>Synchronize</b>""" |
237 """<p>Synchronizes the database.</p>""" |
237 """<p>Synchronizes the database.</p>""" |
238 )) |
238 )) |
239 self.syncDatabaseAct.triggered[()].connect(self.__databaseSynchronize) |
239 self.syncDatabaseAct.triggered[()].connect(self.__databaseSynchronize) |
240 self.actions.append(self.syncDatabaseAct) |
240 self.actions.append(self.syncDatabaseAct) |
241 |
241 |
242 self.inspectDatabaseAct = E5Action(self.trUtf8('Introspect'), |
242 self.inspectDatabaseAct = E5Action(self.trUtf8('Introspect'), |
243 self.trUtf8('&Introspect'), |
243 self.trUtf8('&Introspect'), |
244 0, 0, |
244 0, 0, |
245 self,'django_database_inspect') |
245 self, 'django_database_inspect') |
246 self.inspectDatabaseAct.setStatusTip(self.trUtf8( |
246 self.inspectDatabaseAct.setStatusTip(self.trUtf8( |
247 'Introspects the database tables and outputs a Django model module')) |
247 'Introspects the database tables and outputs a Django model module')) |
248 self.inspectDatabaseAct.setWhatsThis(self.trUtf8( |
248 self.inspectDatabaseAct.setWhatsThis(self.trUtf8( |
249 """<b>Introspect</b>""" |
249 """<b>Introspect</b>""" |
250 """<p>Introspects the database tables and outputs a """ |
250 """<p>Introspects the database tables and outputs a """ |
252 )) |
252 )) |
253 self.inspectDatabaseAct.triggered[()].connect(self.__databaseInspect) |
253 self.inspectDatabaseAct.triggered[()].connect(self.__databaseInspect) |
254 self.actions.append(self.inspectDatabaseAct) |
254 self.actions.append(self.inspectDatabaseAct) |
255 |
255 |
256 self.flushDatabaseAct = E5Action(self.trUtf8('Flush'), |
256 self.flushDatabaseAct = E5Action(self.trUtf8('Flush'), |
257 self.trUtf8('&Flush'), |
257 self.trUtf8('&Flush'), |
258 0, 0, |
258 0, 0, |
259 self,'django_database_flush') |
259 self, 'django_database_flush') |
260 self.flushDatabaseAct.setStatusTip(self.trUtf8( |
260 self.flushDatabaseAct.setStatusTip(self.trUtf8( |
261 'Returns all database tables to the state just after their installation')) |
261 'Returns all database tables to the state just after their installation')) |
262 self.flushDatabaseAct.setWhatsThis(self.trUtf8( |
262 self.flushDatabaseAct.setWhatsThis(self.trUtf8( |
263 """<b>Flush</b>""" |
263 """<b>Flush</b>""" |
264 """<p>Returns all database tables to the state """ |
264 """<p>Returns all database tables to the state """ |
266 )) |
266 )) |
267 self.flushDatabaseAct.triggered[()].connect(self.__databaseFlush) |
267 self.flushDatabaseAct.triggered[()].connect(self.__databaseFlush) |
268 self.actions.append(self.flushDatabaseAct) |
268 self.actions.append(self.flushDatabaseAct) |
269 |
269 |
270 self.databaseClientAct = E5Action(self.trUtf8('Start Client Console'), |
270 self.databaseClientAct = E5Action(self.trUtf8('Start Client Console'), |
271 self.trUtf8('Start &Client Console'), |
271 self.trUtf8('Start &Client Console'), |
272 0, 0, |
272 0, 0, |
273 self,'django_database_client') |
273 self, 'django_database_client') |
274 self.databaseClientAct.setStatusTip(self.trUtf8( |
274 self.databaseClientAct.setStatusTip(self.trUtf8( |
275 'Starts a console window for the database client')) |
275 'Starts a console window for the database client')) |
276 self.databaseClientAct.setWhatsThis(self.trUtf8( |
276 self.databaseClientAct.setWhatsThis(self.trUtf8( |
277 """<b>Start Client Console</b>""" |
277 """<b>Start Client Console</b>""" |
278 """<p>Starts a console window for the database client.</p>""" |
278 """<p>Starts a console window for the database client.</p>""" |
283 def __initDatabaseSqlActions(self): |
283 def __initDatabaseSqlActions(self): |
284 """ |
284 """ |
285 Private method to define the database SQL related actions. |
285 Private method to define the database SQL related actions. |
286 """ |
286 """ |
287 self.databaseSqlCreateTablesAct = E5Action(self.trUtf8('Create Tables'), |
287 self.databaseSqlCreateTablesAct = E5Action(self.trUtf8('Create Tables'), |
288 self.trUtf8('Create &Tables'), |
288 self.trUtf8('Create &Tables'), |
289 0, 0, |
289 0, 0, |
290 self,'django_database_sql_create_tables') |
290 self, 'django_database_sql_create_tables') |
291 self.databaseSqlCreateTablesAct.setStatusTip(self.trUtf8( |
291 self.databaseSqlCreateTablesAct.setStatusTip(self.trUtf8( |
292 'Prints the CREATE TABLE SQL statements for one or more applications')) |
292 'Prints the CREATE TABLE SQL statements for one or more applications')) |
293 self.databaseSqlCreateTablesAct.setWhatsThis(self.trUtf8( |
293 self.databaseSqlCreateTablesAct.setWhatsThis(self.trUtf8( |
294 """<b>Create Tables</b>""" |
294 """<b>Create Tables</b>""" |
295 """<p>Prints the CREATE TABLE SQL statements for one or """ |
295 """<p>Prints the CREATE TABLE SQL statements for one or """ |
298 self.databaseSqlCreateTablesAct.triggered[()].connect( |
298 self.databaseSqlCreateTablesAct.triggered[()].connect( |
299 self.__databaseSqlCreateTables) |
299 self.__databaseSqlCreateTables) |
300 self.actions.append(self.databaseSqlCreateTablesAct) |
300 self.actions.append(self.databaseSqlCreateTablesAct) |
301 |
301 |
302 self.databaseSqlCreateIndexesAct = E5Action(self.trUtf8('Create Indexes'), |
302 self.databaseSqlCreateIndexesAct = E5Action(self.trUtf8('Create Indexes'), |
303 self.trUtf8('Create &Indexes'), |
303 self.trUtf8('Create &Indexes'), |
304 0, 0, |
304 0, 0, |
305 self,'django_database_sql_create_indexes') |
305 self, 'django_database_sql_create_indexes') |
306 self.databaseSqlCreateIndexesAct.setStatusTip(self.trUtf8( |
306 self.databaseSqlCreateIndexesAct.setStatusTip(self.trUtf8( |
307 'Prints the CREATE INDEX SQL statements for one or more applications')) |
307 'Prints the CREATE INDEX SQL statements for one or more applications')) |
308 self.databaseSqlCreateIndexesAct.setWhatsThis(self.trUtf8( |
308 self.databaseSqlCreateIndexesAct.setWhatsThis(self.trUtf8( |
309 """<b>Create Indexes</b>""" |
309 """<b>Create Indexes</b>""" |
310 """<p>Prints the CREATE INDEX SQL statements for one or """ |
310 """<p>Prints the CREATE INDEX SQL statements for one or """ |
313 self.databaseSqlCreateIndexesAct.triggered[()].connect( |
313 self.databaseSqlCreateIndexesAct.triggered[()].connect( |
314 self.__databaseSqlCreateIndexes) |
314 self.__databaseSqlCreateIndexes) |
315 self.actions.append(self.databaseSqlCreateIndexesAct) |
315 self.actions.append(self.databaseSqlCreateIndexesAct) |
316 |
316 |
317 self.databaseSqlCreateEverythingAct = E5Action(self.trUtf8('Create Everything'), |
317 self.databaseSqlCreateEverythingAct = E5Action(self.trUtf8('Create Everything'), |
318 self.trUtf8('Create &Everything'), |
318 self.trUtf8('Create &Everything'), |
319 0, 0, |
319 0, 0, |
320 self,'django_database_sql_create_everything') |
320 self, 'django_database_sql_create_everything') |
321 self.databaseSqlCreateEverythingAct.setStatusTip(self.trUtf8( |
321 self.databaseSqlCreateEverythingAct.setStatusTip(self.trUtf8( |
322 'Prints the CREATE ... SQL statements for one or more applications')) |
322 'Prints the CREATE ... SQL statements for one or more applications')) |
323 self.databaseSqlCreateEverythingAct.setWhatsThis(self.trUtf8( |
323 self.databaseSqlCreateEverythingAct.setWhatsThis(self.trUtf8( |
324 """<b>Create Everything</b>""" |
324 """<b>Create Everything</b>""" |
325 """<p>Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL """ |
325 """<p>Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL """ |
328 self.databaseSqlCreateEverythingAct.triggered[()].connect( |
328 self.databaseSqlCreateEverythingAct.triggered[()].connect( |
329 self.__databaseSqlCreateEverything) |
329 self.__databaseSqlCreateEverything) |
330 self.actions.append(self.databaseSqlCreateEverythingAct) |
330 self.actions.append(self.databaseSqlCreateEverythingAct) |
331 |
331 |
332 self.databaseSqlCustomAct = E5Action(self.trUtf8('Custom Statements'), |
332 self.databaseSqlCustomAct = E5Action(self.trUtf8('Custom Statements'), |
333 self.trUtf8('&Custom Statements'), |
333 self.trUtf8('&Custom Statements'), |
334 0, 0, |
334 0, 0, |
335 self,'django_database_sql_custom') |
335 self, 'django_database_sql_custom') |
336 self.databaseSqlCustomAct.setStatusTip(self.trUtf8( |
336 self.databaseSqlCustomAct.setStatusTip(self.trUtf8( |
337 'Prints the custom table modifying SQL statements for ' |
337 'Prints the custom table modifying SQL statements for ' |
338 'one or more applications')) |
338 'one or more applications')) |
339 self.databaseSqlCustomAct.setWhatsThis(self.trUtf8( |
339 self.databaseSqlCustomAct.setWhatsThis(self.trUtf8( |
340 """<b>Custom Statements</b>""" |
340 """<b>Custom Statements</b>""" |
344 self.databaseSqlCustomAct.triggered[()].connect( |
344 self.databaseSqlCustomAct.triggered[()].connect( |
345 self.__databaseSqlCustom) |
345 self.__databaseSqlCustom) |
346 self.actions.append(self.databaseSqlCustomAct) |
346 self.actions.append(self.databaseSqlCustomAct) |
347 |
347 |
348 self.databaseSqlDropTablesAct = E5Action(self.trUtf8('Drop Tables'), |
348 self.databaseSqlDropTablesAct = E5Action(self.trUtf8('Drop Tables'), |
349 self.trUtf8('&Drop Tables'), |
349 self.trUtf8('&Drop Tables'), |
350 0, 0, |
350 0, 0, |
351 self,'django_database_sql_drop_tables') |
351 self, 'django_database_sql_drop_tables') |
352 self.databaseSqlDropTablesAct.setStatusTip(self.trUtf8( |
352 self.databaseSqlDropTablesAct.setStatusTip(self.trUtf8( |
353 'Prints the DROP TABLE SQL statements for ' |
353 'Prints the DROP TABLE SQL statements for ' |
354 'one or more applications')) |
354 'one or more applications')) |
355 self.databaseSqlDropTablesAct.setWhatsThis(self.trUtf8( |
355 self.databaseSqlDropTablesAct.setWhatsThis(self.trUtf8( |
356 """<b>Drop Tables</b>""" |
356 """<b>Drop Tables</b>""" |
360 self.databaseSqlDropTablesAct.triggered[()].connect( |
360 self.databaseSqlDropTablesAct.triggered[()].connect( |
361 self.__databaseSqlDropTables) |
361 self.__databaseSqlDropTables) |
362 self.actions.append(self.databaseSqlDropTablesAct) |
362 self.actions.append(self.databaseSqlDropTablesAct) |
363 |
363 |
364 self.databaseSqlFlushAct = E5Action(self.trUtf8('Flush Database'), |
364 self.databaseSqlFlushAct = E5Action(self.trUtf8('Flush Database'), |
365 self.trUtf8('&Flush Database'), |
365 self.trUtf8('&Flush Database'), |
366 0, 0, |
366 0, 0, |
367 self,'django_database_sql_flush_database') |
367 self, 'django_database_sql_flush_database') |
368 self.databaseSqlFlushAct.setStatusTip(self.trUtf8( |
368 self.databaseSqlFlushAct.setStatusTip(self.trUtf8( |
369 'Prints a list of statements to return all database tables to the state ' |
369 'Prints a list of statements to return all database tables to the state ' |
370 'just after their installation')) |
370 'just after their installation')) |
371 self.databaseSqlFlushAct.setWhatsThis(self.trUtf8( |
371 self.databaseSqlFlushAct.setWhatsThis(self.trUtf8( |
372 """<b>Flush Database</b>""" |
372 """<b>Flush Database</b>""" |
376 self.databaseSqlFlushAct.triggered[()].connect( |
376 self.databaseSqlFlushAct.triggered[()].connect( |
377 self.__databaseSqlFlushDatabase) |
377 self.__databaseSqlFlushDatabase) |
378 self.actions.append(self.databaseSqlFlushAct) |
378 self.actions.append(self.databaseSqlFlushAct) |
379 |
379 |
380 self.databaseSqlResetSeqAct = E5Action(self.trUtf8('Reset Sequences'), |
380 self.databaseSqlResetSeqAct = E5Action(self.trUtf8('Reset Sequences'), |
381 self.trUtf8('Reset &Sequences'), |
381 self.trUtf8('Reset &Sequences'), |
382 0, 0, |
382 0, 0, |
383 self,'django_database_sql_reset_sequences') |
383 self, 'django_database_sql_reset_sequences') |
384 self.databaseSqlResetSeqAct.setStatusTip(self.trUtf8( |
384 self.databaseSqlResetSeqAct.setStatusTip(self.trUtf8( |
385 'Prints the SQL statements for resetting sequences for ' |
385 'Prints the SQL statements for resetting sequences for ' |
386 'one or more applications')) |
386 'one or more applications')) |
387 self.databaseSqlResetSeqAct.setWhatsThis(self.trUtf8( |
387 self.databaseSqlResetSeqAct.setWhatsThis(self.trUtf8( |
388 """<b>Reset Sequences</b>""" |
388 """<b>Reset Sequences</b>""" |
396 def __initToolsActions(self): |
396 def __initToolsActions(self): |
397 """ |
397 """ |
398 Private method to define the tool actions. |
398 Private method to define the tool actions. |
399 """ |
399 """ |
400 self.diffSettingsAct = E5Action(self.trUtf8('Diff Settings'), |
400 self.diffSettingsAct = E5Action(self.trUtf8('Diff Settings'), |
401 self.trUtf8('&Diff Settings'), |
401 self.trUtf8('&Diff Settings'), |
402 0, 0, |
402 0, 0, |
403 self,'django_tools_diffsettings') |
403 self, 'django_tools_diffsettings') |
404 self.diffSettingsAct.setStatusTip(self.trUtf8( |
404 self.diffSettingsAct.setStatusTip(self.trUtf8( |
405 'Shows the modification made to the settings')) |
405 'Shows the modification made to the settings')) |
406 self.diffSettingsAct.setWhatsThis(self.trUtf8( |
406 self.diffSettingsAct.setWhatsThis(self.trUtf8( |
407 """<b>Diff Settings</b>""" |
407 """<b>Diff Settings</b>""" |
408 """<p>Shows the modification made to the settings.</p>""" |
408 """<p>Shows the modification made to the settings.</p>""" |
409 )) |
409 )) |
410 self.diffSettingsAct.triggered[()].connect(self.__diffSettings) |
410 self.diffSettingsAct.triggered[()].connect(self.__diffSettings) |
411 self.actions.append(self.diffSettingsAct) |
411 self.actions.append(self.diffSettingsAct) |
412 |
412 |
413 self.cleanupAct = E5Action(self.trUtf8('Cleanup'), |
413 self.cleanupAct = E5Action(self.trUtf8('Cleanup'), |
414 self.trUtf8('&Cleanup'), |
414 self.trUtf8('&Cleanup'), |
415 0, 0, |
415 0, 0, |
416 self,'django_tools_cleanup') |
416 self, 'django_tools_cleanup') |
417 self.cleanupAct.setStatusTip(self.trUtf8( |
417 self.cleanupAct.setStatusTip(self.trUtf8( |
418 'Cleans out old data from the database')) |
418 'Cleans out old data from the database')) |
419 self.cleanupAct.setWhatsThis(self.trUtf8( |
419 self.cleanupAct.setWhatsThis(self.trUtf8( |
420 """<b>Cleanup</b>""" |
420 """<b>Cleanup</b>""" |
421 """<p>Cleans out old data from the database.</p>""" |
421 """<p>Cleans out old data from the database.</p>""" |
422 )) |
422 )) |
423 self.cleanupAct.triggered[()].connect(self.__cleanup) |
423 self.cleanupAct.triggered[()].connect(self.__cleanup) |
424 self.actions.append(self.cleanupAct) |
424 self.actions.append(self.cleanupAct) |
425 |
425 |
426 self.validateAct = E5Action(self.trUtf8('Validate'), |
426 self.validateAct = E5Action(self.trUtf8('Validate'), |
427 self.trUtf8('&Validate'), |
427 self.trUtf8('&Validate'), |
428 0, 0, |
428 0, 0, |
429 self,'django_tools_validate') |
429 self, 'django_tools_validate') |
430 self.validateAct.setStatusTip(self.trUtf8( |
430 self.validateAct.setStatusTip(self.trUtf8( |
431 'Validates all installed models')) |
431 'Validates all installed models')) |
432 self.validateAct.setWhatsThis(self.trUtf8( |
432 self.validateAct.setWhatsThis(self.trUtf8( |
433 """<b>Validate</b>""" |
433 """<b>Validate</b>""" |
434 """<p>Validates all installed models.</p>""" |
434 """<p>Validates all installed models.</p>""" |
435 )) |
435 )) |
436 self.validateAct.triggered[()].connect(self.__validate) |
436 self.validateAct.triggered[()].connect(self.__validate) |
437 self.actions.append(self.validateAct) |
437 self.actions.append(self.validateAct) |
438 |
438 |
439 self.runPythonShellAct = E5Action(self.trUtf8('Start Python Console'), |
439 self.runPythonShellAct = E5Action(self.trUtf8('Start Python Console'), |
440 self.trUtf8('Start &Python Console'), |
440 self.trUtf8('Start &Python Console'), |
441 0, 0, |
441 0, 0, |
442 self,'django_tools_pythonconsole') |
442 self, 'django_tools_pythonconsole') |
443 self.runPythonShellAct.setStatusTip(self.trUtf8( |
443 self.runPythonShellAct.setStatusTip(self.trUtf8( |
444 'Starts a Python interactive interpreter')) |
444 'Starts a Python interactive interpreter')) |
445 self.runPythonShellAct.setWhatsThis(self.trUtf8( |
445 self.runPythonShellAct.setWhatsThis(self.trUtf8( |
446 """<b>Start Python Console</b>""" |
446 """<b>Start Python Console</b>""" |
447 """<p>Starts a Python interactive interpreter.</p>""" |
447 """<p>Starts a Python interactive interpreter.</p>""" |
452 def __initTestingActions(self): |
452 def __initTestingActions(self): |
453 """ |
453 """ |
454 Private method to define the testing actions. |
454 Private method to define the testing actions. |
455 """ |
455 """ |
456 self.dumpDataAct = E5Action(self.trUtf8('Dump Data'), |
456 self.dumpDataAct = E5Action(self.trUtf8('Dump Data'), |
457 self.trUtf8('&Dump Data'), |
457 self.trUtf8('&Dump Data'), |
458 0, 0, |
458 0, 0, |
459 self,'django_tools_dumpdata') |
459 self, 'django_tools_dumpdata') |
460 self.dumpDataAct.setStatusTip(self.trUtf8( |
460 self.dumpDataAct.setStatusTip(self.trUtf8( |
461 'Dump the database data to a fixture')) |
461 'Dump the database data to a fixture')) |
462 self.dumpDataAct.setWhatsThis(self.trUtf8( |
462 self.dumpDataAct.setWhatsThis(self.trUtf8( |
463 """<b>Dump Data</b>""" |
463 """<b>Dump Data</b>""" |
464 """<p>Dump the database data to a fixture.</p>""" |
464 """<p>Dump the database data to a fixture.</p>""" |
465 )) |
465 )) |
466 self.dumpDataAct.triggered[()].connect(self.__dumpData) |
466 self.dumpDataAct.triggered[()].connect(self.__dumpData) |
467 self.actions.append(self.dumpDataAct) |
467 self.actions.append(self.dumpDataAct) |
468 |
468 |
469 self.loadDataAct = E5Action(self.trUtf8('Load Data'), |
469 self.loadDataAct = E5Action(self.trUtf8('Load Data'), |
470 self.trUtf8('&Load Data'), |
470 self.trUtf8('&Load Data'), |
471 0, 0, |
471 0, 0, |
472 self,'django_tools_loaddata') |
472 self, 'django_tools_loaddata') |
473 self.loadDataAct.setStatusTip(self.trUtf8( |
473 self.loadDataAct.setStatusTip(self.trUtf8( |
474 'Load data from fixture files')) |
474 'Load data from fixture files')) |
475 self.loadDataAct.setWhatsThis(self.trUtf8( |
475 self.loadDataAct.setWhatsThis(self.trUtf8( |
476 """<b>Load Data</b>""" |
476 """<b>Load Data</b>""" |
477 """<p>Load data from fixture files.</p>""" |
477 """<p>Load data from fixture files.</p>""" |
478 )) |
478 )) |
479 self.loadDataAct.triggered[()].connect(self.__loadData) |
479 self.loadDataAct.triggered[()].connect(self.__loadData) |
480 self.actions.append(self.loadDataAct) |
480 self.actions.append(self.loadDataAct) |
481 |
481 |
482 self.runTestAct = E5Action(self.trUtf8('Run Testsuite'), |
482 self.runTestAct = E5Action(self.trUtf8('Run Testsuite'), |
483 self.trUtf8('Run &Testsuite'), |
483 self.trUtf8('Run &Testsuite'), |
484 0, 0, |
484 0, 0, |
485 self,'django_tools_run_test') |
485 self, 'django_tools_run_test') |
486 self.runTestAct.setStatusTip(self.trUtf8( |
486 self.runTestAct.setStatusTip(self.trUtf8( |
487 'Run the test suite for applications or the whole site')) |
487 'Run the test suite for applications or the whole site')) |
488 self.runTestAct.setWhatsThis(self.trUtf8( |
488 self.runTestAct.setWhatsThis(self.trUtf8( |
489 """<b>Run Testsuite</b>""" |
489 """<b>Run Testsuite</b>""" |
490 """<p>Run the test suite for applications or the whole site.</p>""" |
490 """<p>Run the test suite for applications or the whole site.</p>""" |
491 )) |
491 )) |
492 self.runTestAct.triggered[()].connect(self.__runTestSuite) |
492 self.runTestAct.triggered[()].connect(self.__runTestSuite) |
493 self.actions.append(self.runTestAct) |
493 self.actions.append(self.runTestAct) |
494 |
494 |
495 self.runTestServerAct = E5Action(self.trUtf8('Run Testserver'), |
495 self.runTestServerAct = E5Action(self.trUtf8('Run Testserver'), |
496 self.trUtf8('Run Test&server'), |
496 self.trUtf8('Run Test&server'), |
497 0, 0, |
497 0, 0, |
498 self,'django_tools_run_test_server') |
498 self, 'django_tools_run_test_server') |
499 self.runTestServerAct.setStatusTip(self.trUtf8( |
499 self.runTestServerAct.setStatusTip(self.trUtf8( |
500 'Run a development server with data from a set of fixtures')) |
500 'Run a development server with data from a set of fixtures')) |
501 self.runTestServerAct.setWhatsThis(self.trUtf8( |
501 self.runTestServerAct.setWhatsThis(self.trUtf8( |
502 """<b>Run Testserver</b>""" |
502 """<b>Run Testserver</b>""" |
503 """<p>Run a development server with data from a set of fixtures.</p>""" |
503 """<p>Run a development server with data from a set of fixtures.</p>""" |
508 def __initAuthorizationActions(self): |
508 def __initAuthorizationActions(self): |
509 """ |
509 """ |
510 Private method to define the authorization actions. |
510 Private method to define the authorization actions. |
511 """ |
511 """ |
512 self.changePasswordAct = E5Action(self.trUtf8('Change Password'), |
512 self.changePasswordAct = E5Action(self.trUtf8('Change Password'), |
513 self.trUtf8('Change &Password'), |
513 self.trUtf8('Change &Password'), |
514 0, 0, |
514 0, 0, |
515 self,'django_auth_changepassword') |
515 self, 'django_auth_changepassword') |
516 self.changePasswordAct.setStatusTip(self.trUtf8( |
516 self.changePasswordAct.setStatusTip(self.trUtf8( |
517 'Change the password of a user')) |
517 'Change the password of a user')) |
518 self.changePasswordAct.setWhatsThis(self.trUtf8( |
518 self.changePasswordAct.setWhatsThis(self.trUtf8( |
519 """<b>Change Password</b>""" |
519 """<b>Change Password</b>""" |
520 """<p>Change the password of a user of the Django project.</p>""" |
520 """<p>Change the password of a user of the Django project.</p>""" |
521 )) |
521 )) |
522 self.changePasswordAct.triggered[()].connect(self.__changePassword) |
522 self.changePasswordAct.triggered[()].connect(self.__changePassword) |
523 self.actions.append(self.changePasswordAct) |
523 self.actions.append(self.changePasswordAct) |
524 |
524 |
525 self.createSuperUserAct = E5Action(self.trUtf8('Create Superuser'), |
525 self.createSuperUserAct = E5Action(self.trUtf8('Create Superuser'), |
526 self.trUtf8('Create &Superuser'), |
526 self.trUtf8('Create &Superuser'), |
527 0, 0, |
527 0, 0, |
528 self,'django_auth_createsuperuser') |
528 self, 'django_auth_createsuperuser') |
529 self.createSuperUserAct.setStatusTip(self.trUtf8( |
529 self.createSuperUserAct.setStatusTip(self.trUtf8( |
530 'Create a superuser account')) |
530 'Create a superuser account')) |
531 self.createSuperUserAct.setWhatsThis(self.trUtf8( |
531 self.createSuperUserAct.setWhatsThis(self.trUtf8( |
532 """<b>Create Superuser</b>""" |
532 """<b>Create Superuser</b>""" |
533 """<p>Create a superuser account for the Django project.</p>""" |
533 """<p>Create a superuser account for the Django project.</p>""" |
538 def __initSessionActions(self): |
538 def __initSessionActions(self): |
539 """ |
539 """ |
540 Private method to define the session actions. |
540 Private method to define the session actions. |
541 """ |
541 """ |
542 self.clearSessionsAct = E5Action(self.trUtf8('Clear Sessions'), |
542 self.clearSessionsAct = E5Action(self.trUtf8('Clear Sessions'), |
543 self.trUtf8('Clear &Sessions'), |
543 self.trUtf8('Clear &Sessions'), |
544 0, 0, |
544 0, 0, |
545 self,'django_session_clearsessions') |
545 self, 'django_session_clearsessions') |
546 self.clearSessionsAct.setStatusTip(self.trUtf8( |
546 self.clearSessionsAct.setStatusTip(self.trUtf8( |
547 'Clear expired sessions')) |
547 'Clear expired sessions')) |
548 self.clearSessionsAct.setWhatsThis(self.trUtf8( |
548 self.clearSessionsAct.setWhatsThis(self.trUtf8( |
549 """<b>Clear Sessions</b>""" |
549 """<b>Clear Sessions</b>""" |
550 """<p>Clear expired sessions of the Django project.</p>""" |
550 """<p>Clear expired sessions of the Django project.</p>""" |
703 Public method to add our hook methods. |
703 Public method to add our hook methods. |
704 """ |
704 """ |
705 if self.__e5project.getProjectType() == "Django": |
705 if self.__e5project.getProjectType() == "Django": |
706 self.__formsBrowser = \ |
706 self.__formsBrowser = \ |
707 e5App().getObject("ProjectBrowser").getProjectBrowser("forms") |
707 e5App().getObject("ProjectBrowser").getProjectBrowser("forms") |
708 self.__formsBrowser.addHookMethodAndMenuEntry("newForm", |
708 self.__formsBrowser.addHookMethodAndMenuEntry("newForm", |
709 self.newForm, self.trUtf8("New template...")) |
709 self.newForm, self.trUtf8("New template...")) |
710 |
710 |
711 self.__e5project.projectLanguageAddedByCode.connect( |
711 self.__e5project.projectLanguageAddedByCode.connect( |
712 self.__projectLanguageAdded) |
712 self.__projectLanguageAdded) |
713 self.__translationsBrowser = \ |
713 self.__translationsBrowser = \ |
714 e5App().getObject("ProjectBrowser").getProjectBrowser("translations") |
714 e5App().getObject("ProjectBrowser").getProjectBrowser("translations") |
715 self.__translationsBrowser.addHookMethodAndMenuEntry("generateAll", |
715 self.__translationsBrowser.addHookMethodAndMenuEntry("generateAll", |
716 self.updateCatalogs, self.trUtf8("Update all catalogs")) |
716 self.updateCatalogs, self.trUtf8("Update all catalogs")) |
717 self.__translationsBrowser.addHookMethodAndMenuEntry("generateSelected", |
717 self.__translationsBrowser.addHookMethodAndMenuEntry("generateSelected", |
718 self.updateSelectedCatalogs, self.trUtf8("Update selected catalogs")) |
718 self.updateSelectedCatalogs, self.trUtf8("Update selected catalogs")) |
719 self.__translationsBrowser.addHookMethodAndMenuEntry( |
719 self.__translationsBrowser.addHookMethodAndMenuEntry( |
720 "generateAllWithObsolete", self.updateCatalogsWithObsolete, |
720 "generateAllWithObsolete", self.updateCatalogsWithObsolete, |
721 self.trUtf8("Update all catalogs (with obsolete)")) |
721 self.trUtf8("Update all catalogs (with obsolete)")) |
722 self.__translationsBrowser.addHookMethodAndMenuEntry( |
722 self.__translationsBrowser.addHookMethodAndMenuEntry( |
723 "generateSelectedWithObsolete", self.updateSelectedCatalogsWithObsolete, |
723 "generateSelectedWithObsolete", self.updateSelectedCatalogsWithObsolete, |
724 self.trUtf8("Update selected catalogs (with obsolete)")) |
724 self.trUtf8("Update selected catalogs (with obsolete)")) |
725 self.__translationsBrowser.addHookMethodAndMenuEntry("releaseAll", |
725 self.__translationsBrowser.addHookMethodAndMenuEntry("releaseAll", |
726 self.compileCatalogs, self.trUtf8("Compile all catalogs")) |
726 self.compileCatalogs, self.trUtf8("Compile all catalogs")) |
727 self.__translationsBrowser.addHookMethodAndMenuEntry("releaseSelected", |
727 self.__translationsBrowser.addHookMethodAndMenuEntry("releaseSelected", |
728 self.compileSelectedCatalogs, |
728 self.compileSelectedCatalogs, |
729 self.trUtf8("Compile selected catalogs")) |
729 self.trUtf8("Compile selected catalogs")) |
730 |
730 |
731 self.__hooksInstalled = True |
731 self.__hooksInstalled = True |
732 |
732 |
733 def projectClosedHooks(self): |
733 def projectClosedHooks(self): |
1040 QLineEdit.Normal) |
1040 QLineEdit.Normal) |
1041 if ok and projectName != "": |
1041 if ok and projectName != "": |
1042 res = self.__createProject(projectName, self.__e5project.getProjectPath()) |
1042 res = self.__createProject(projectName, self.__e5project.getProjectPath()) |
1043 if res: |
1043 if res: |
1044 # search for new files and add them to the project |
1044 # search for new files and add them to the project |
1045 sitePath = os.path.join(self.__e5project.getProjectPath(), |
1045 sitePath = os.path.join(self.__e5project.getProjectPath(), |
1046 projectName) |
1046 projectName) |
1047 for entry in os.walk(sitePath): |
1047 for entry in os.walk(sitePath): |
1048 for fileName in entry[2]: |
1048 for fileName in entry[2]: |
1049 fullName = os.path.join(entry[0], fileName) |
1049 fullName = os.path.join(entry[0], fileName) |
1050 self.__e5project.appendFile(fullName) |
1050 self.__e5project.appendFile(fullName) |
1051 |
1051 |
1052 def __createApplication(self, applName, path, isGlobal = True): |
1052 def __createApplication(self, applName, path, isGlobal=True): |
1053 """ |
1053 """ |
1054 Private slot to create a new Django application. |
1054 Private slot to create a new Django application. |
1055 |
1055 |
1056 @param applName name of the new application (string) |
1056 @param applName name of the new application (string) |
1057 @param path the directory where the application should be created |
1057 @param path the directory where the application should be created |
1442 args.append(command) |
1442 args.append(command) |
1443 args += apps |
1443 args += apps |
1444 |
1444 |
1445 fileFilter = self.trUtf8("SQL Files (*.sql)") |
1445 fileFilter = self.trUtf8("SQL Files (*.sql)") |
1446 |
1446 |
1447 dia = DjangoDialog(title, fixed = True, linewrap = False, |
1447 dia = DjangoDialog(title, fixed=True, linewrap=False, |
1448 saveFilters = fileFilter) |
1448 saveFilters=fileFilter) |
1449 res = dia.startProcess(args, path, False) |
1449 res = dia.startProcess(args, path, False) |
1450 if res: |
1450 if res: |
1451 dia.exec_() |
1451 dia.exec_() |
1452 |
1452 |
1453 def __databaseSqlCreateTables(self): |
1453 def __databaseSqlCreateTables(self): |
1454 """ |
1454 """ |
1455 Private slot to print the CREATE TABLE SQL statements for one |
1455 Private slot to print the CREATE TABLE SQL statements for one |
1456 or more applications. |
1456 or more applications. |
1457 """ |
1457 """ |
1458 self.__sqlCommand(self.trUtf8("Create Tables"), "sql") |
1458 self.__sqlCommand(self.trUtf8("Create Tables"), "sql") |
1459 |
1459 |
1460 def __databaseSqlCreateIndexes(self): |
1460 def __databaseSqlCreateIndexes(self): |
1461 """ |
1461 """ |
1462 Private slot to print the CREATE INDEX SQL statements for one |
1462 Private slot to print the CREATE INDEX SQL statements for one |
1463 or more applications. |
1463 or more applications. |
1464 """ |
1464 """ |
1465 self.__sqlCommand(self.trUtf8("Create Indexes"), "sqlindexes") |
1465 self.__sqlCommand(self.trUtf8("Create Indexes"), "sqlindexes") |
1466 |
1466 |
1467 def __databaseSqlCreateEverything(self): |
1467 def __databaseSqlCreateEverything(self): |
1468 """ |
1468 """ |
1469 Private slot to print the CREATE TABLE, custom SQL and |
1469 Private slot to print the CREATE TABLE, custom SQL and |
1470 CREATE INDEX SQL statements for one or more applications. |
1470 CREATE INDEX SQL statements for one or more applications. |
1471 """ |
1471 """ |
1472 self.__sqlCommand(self.trUtf8("Create Everything"), "sqlall") |
1472 self.__sqlCommand(self.trUtf8("Create Everything"), "sqlall") |
1473 |
1473 |
1474 def __databaseSqlCustom(self): |
1474 def __databaseSqlCustom(self): |
1661 elif format == "xml": |
1661 elif format == "xml": |
1662 fileFilters = self.trUtf8("XML Files (*.xml)") |
1662 fileFilters = self.trUtf8("XML Files (*.xml)") |
1663 elif format == "yaml": |
1663 elif format == "yaml": |
1664 fileFilters = self.trUtf8("YAML Files (*.yaml)") |
1664 fileFilters = self.trUtf8("YAML Files (*.yaml)") |
1665 |
1665 |
1666 dia = DjangoDialog(title, fixed = True, linewrap = False, |
1666 dia = DjangoDialog(title, fixed=True, linewrap=False, |
1667 saveFilters = fileFilters) |
1667 saveFilters=fileFilters) |
1668 res = dia.startProcess(args, wd, showCommand = False) |
1668 res = dia.startProcess(args, wd, showCommand=False) |
1669 if res: |
1669 if res: |
1670 dia.exec_() |
1670 dia.exec_() |
1671 |
1671 |
1672 def __loadData(self): |
1672 def __loadData(self): |
1673 """ |
1673 """ |