ProjectDjango/Project.py

changeset 6
80815349eef4
parent 5
96a317de4626
child 8
07d64408f2b7
equal deleted inserted replaced
5:96a317de4626 6:80815349eef4
70 self.actions = [] 70 self.actions = []
71 71
72 self.selectSiteAct = E5Action(self.trUtf8('Current Project'), 72 self.selectSiteAct = E5Action(self.trUtf8('Current Project'),
73 "", 73 "",
74 0, 0, 74 0, 0,
75 self,'django_current_project') 75 self, 'django_current_project')
76 self.selectSiteAct.setStatusTip(self.trUtf8( 76 self.selectSiteAct.setStatusTip(self.trUtf8(
77 'Selects the current project')) 77 'Selects the current project'))
78 self.selectSiteAct.setWhatsThis(self.trUtf8( 78 self.selectSiteAct.setWhatsThis(self.trUtf8(
79 """<b>Current Project</b>""" 79 """<b>Current Project</b>"""
80 """<p>Selects the current project. Used for multi-project """ 80 """<p>Selects the current project. Used for multi-project """
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):
888 888
889 def __saveRecentApplications(self): 889 def __saveRecentApplications(self):
890 """ 890 """
891 Private method to save the list of recently used applications list. 891 Private method to save the list of recently used applications list.
892 """ 892 """
893 Preferences.Prefs.rsettings.setValue(self.RecentApplicationsKey, 893 Preferences.Prefs.rsettings.setValue(self.RecentApplicationsKey,
894 self.__recentApplications) 894 self.__recentApplications)
895 Preferences.Prefs.rsettings.sync() 895 Preferences.Prefs.rsettings.sync()
896 896
897 def getRecentApplications(self): 897 def getRecentApplications(self):
898 """ 898 """
937 937
938 def __showHelpIndex(self): 938 def __showHelpIndex(self):
939 """ 939 """
940 Private slot to show the help index page. 940 Private slot to show the help index page.
941 """ 941 """
942 page = os.path.join(os.path.dirname(__file__), 942 page = os.path.join(os.path.dirname(__file__),
943 "Documentation", "help", "index.html") 943 "Documentation", "help", "index.html")
944 self.__ui.launchHelpViewer(page) 944 self.__ui.launchHelpViewer(page)
945 945
946 def __isSpawningConsole(self, consoleCmd): 946 def __isSpawningConsole(self, consoleCmd):
947 """ 947 """
1009 # fall back 1009 # fall back
1010 args.append("django-admin.py") 1010 args.append("django-admin.py")
1011 args.append("startproject") 1011 args.append("startproject")
1012 args.append(projectName) 1012 args.append(projectName)
1013 1013
1014 dia = DjangoDialog(title, 1014 dia = DjangoDialog(title,
1015 msgSuccess = self.trUtf8("Django project created successfully.")) 1015 msgSuccess=self.trUtf8("Django project created successfully."))
1016 res = dia.startProcess(args, path) 1016 res = dia.startProcess(args, path)
1017 if res: 1017 if res:
1018 dia.exec_() 1018 dia.exec_()
1019 1019
1020 # create the base directory for translations 1020 # create the base directory for translations
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
1082 except DjangoNoSiteSelectedException: 1082 except DjangoNoSiteSelectedException:
1083 return False 1083 return False
1084 args.append("startapp") 1084 args.append("startapp")
1085 args.append(applName) 1085 args.append(applName)
1086 1086
1087 dia = DjangoDialog(title, 1087 dia = DjangoDialog(title,
1088 msgSuccess = self.trUtf8("Django application created successfully.")) 1088 msgSuccess=self.trUtf8("Django application created successfully."))
1089 res = dia.startProcess(args, path) 1089 res = dia.startProcess(args, path)
1090 if res: 1090 if res:
1091 dia.exec_() 1091 dia.exec_()
1092 return res 1092 return res
1093 1093
1186 self.__selectSite() 1186 self.__selectSite()
1187 1187
1188 if self.__currentSite is None: 1188 if self.__currentSite is None:
1189 raise DjangoNoSiteSelectedException 1189 raise DjangoNoSiteSelectedException
1190 else: 1190 else:
1191 return os.path.join(self.__e5project.getProjectPath(), 1191 return os.path.join(self.__e5project.getProjectPath(),
1192 self.__currentSite) 1192 self.__currentSite)
1193 1193
1194 def __setCurrentSite(self, site): 1194 def __setCurrentSite(self, site):
1195 """ 1195 """
1196 Private slot to set the current site. 1196 Private slot to set the current site.
1354 try: 1354 try:
1355 path = self.__sitePath() 1355 path = self.__sitePath()
1356 except DjangoNoSiteSelectedException: 1356 except DjangoNoSiteSelectedException:
1357 return 1357 return
1358 1358
1359 dia = DjangoDialog(title, fixed = True, linewrap = False) 1359 dia = DjangoDialog(title, fixed=True, linewrap=False)
1360 res = dia.startProcess(args, path, False) 1360 res = dia.startProcess(args, path, False)
1361 if res: 1361 if res:
1362 dia.exec_() 1362 dia.exec_()
1363 1363
1364 def __databaseFlush(self): 1364 def __databaseFlush(self):
1365 """ 1365 """
1366 Private slot to return all database tables to the state just after their 1366 Private slot to return all database tables to the state just after their
1367 installation. 1367 installation.
1368 """ 1368 """
1369 try: 1369 try:
1370 path = self.__sitePath() 1370 path = self.__sitePath()
1371 except DjangoNoSiteSelectedException: 1371 except DjangoNoSiteSelectedException:
1381 args.append(self.__getPythonExecutable()) 1381 args.append(self.__getPythonExecutable())
1382 args.append("manage.py") 1382 args.append("manage.py")
1383 args.append("flush") 1383 args.append("flush")
1384 args.append("--noinput") 1384 args.append("--noinput")
1385 1385
1386 dia = DjangoDialog(title, 1386 dia = DjangoDialog(title,
1387 msgSuccess = self.trUtf8("Database tables flushed successfully.")) 1387 msgSuccess=self.trUtf8("Database tables flushed successfully."))
1388 res = dia.startProcess(args, path) 1388 res = dia.startProcess(args, path)
1389 if res: 1389 if res:
1390 dia.exec_() 1390 dia.exec_()
1391 1391
1392 def __runDatabaseClient(self): 1392 def __runDatabaseClient(self):
1413 1413
1414 ####################################################################### 1414 #######################################################################
1415 ## slots below implement database functions outputting SQL statements 1415 ## slots below implement database functions outputting SQL statements
1416 ####################################################################### 1416 #######################################################################
1417 1417
1418 def __sqlCommand(self, title, command, requestApps = True): 1418 def __sqlCommand(self, title, command, requestApps=True):
1419 """ 1419 """
1420 Private method to perform an SQL creation function. 1420 Private method to perform an SQL creation function.
1421 1421
1422 @param title dialog title (string) 1422 @param title dialog title (string)
1423 @param command Django sql... command (string) 1423 @param command Django sql... command (string)
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):
1517 try: 1517 try:
1518 path = self.__sitePath() 1518 path = self.__sitePath()
1519 except DjangoNoSiteSelectedException: 1519 except DjangoNoSiteSelectedException:
1520 return 1520 return
1521 1521
1522 dia = DjangoDialog(title, fixed = True, linewrap = False) 1522 dia = DjangoDialog(title, fixed=True, linewrap=False)
1523 res = dia.startProcess(args, path, False) 1523 res = dia.startProcess(args, path, False)
1524 if res: 1524 if res:
1525 dia.exec_() 1525 dia.exec_()
1526 1526
1527 def __cleanup(self): 1527 def __cleanup(self):
1538 try: 1538 try:
1539 path = self.__sitePath() 1539 path = self.__sitePath()
1540 except DjangoNoSiteSelectedException: 1540 except DjangoNoSiteSelectedException:
1541 return 1541 return
1542 1542
1543 dia = DjangoDialog(title, 1543 dia = DjangoDialog(title,
1544 msgSuccess = self.trUtf8("Database cleaned up successfully.")) 1544 msgSuccess=self.trUtf8("Database cleaned up successfully."))
1545 res = dia.startProcess(args, path) 1545 res = dia.startProcess(args, path)
1546 if res: 1546 if res:
1547 dia.exec_() 1547 dia.exec_()
1548 1548
1549 def __validate(self): 1549 def __validate(self):
1618 args.append(self.__getPythonExecutable()) 1618 args.append(self.__getPythonExecutable())
1619 args.append("manage.py") 1619 args.append("manage.py")
1620 args.append("createcachetable") 1620 args.append("createcachetable")
1621 args += tableNames 1621 args += tableNames
1622 1622
1623 dia = DjangoDialog(title, 1623 dia = DjangoDialog(title,
1624 msgSuccess = self.trUtf8("Cache tables created successfully.")) 1624 msgSuccess=self.trUtf8("Cache tables created successfully."))
1625 res = dia.startProcess(args, wd) 1625 res = dia.startProcess(args, wd)
1626 if res: 1626 if res:
1627 dia.exec_() 1627 dia.exec_()
1628 1628
1629 ################################################################## 1629 ##################################################################
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 """
1849 args = [] 1849 args = []
1850 args.append(self.__getPythonExecutable()) 1850 args.append(self.__getPythonExecutable())
1851 args.append("manage.py") 1851 args.append("manage.py")
1852 args.append("clearsessions") 1852 args.append("clearsessions")
1853 1853
1854 dia = DjangoDialog(title, 1854 dia = DjangoDialog(title,
1855 msgSuccess = self.trUtf8("Expired sessions cleared successfully.")) 1855 msgSuccess=self.trUtf8("Expired sessions cleared successfully."))
1856 res = dia.startProcess(args, wd) 1856 res = dia.startProcess(args, wd)
1857 if res: 1857 if res:
1858 dia.exec_() 1858 dia.exec_()
1859 1859
1860 ################################################################## 1860 ##################################################################
1935 title, 1935 title,
1936 self.trUtf8('No current site selected or no site created yet.' 1936 self.trUtf8('No current site selected or no site created yet.'
1937 ' Aborting...')) 1937 ' Aborting...'))
1938 return 1938 return
1939 1939
1940 dia = DjangoDialog(title, 1940 dia = DjangoDialog(title,
1941 msgSuccess = \ 1941 msgSuccess=self.trUtf8("\nMessage catalog initialized successfully."))
1942 self.trUtf8("\nMessage catalog initialized successfully."))
1943 res = dia.startProcess(args, wd) 1942 res = dia.startProcess(args, wd)
1944 if res: 1943 if res:
1945 dia.exec_() 1944 dia.exec_()
1946 1945
1947 langFile = self.__e5project.pdata["TRANSLATIONPATTERN"][0]\ 1946 langFile = self.__e5project.pdata["TRANSLATIONPATTERN"][0]\
1983 E5MessageBox.warning(None, 1982 E5MessageBox.warning(None,
1984 title, 1983 title,
1985 self.trUtf8('No locales detected. Aborting...')) 1984 self.trUtf8('No locales detected. Aborting...'))
1986 return 1985 return
1987 1986
1988 dia = DjangoDialog(title, 1987 dia = DjangoDialog(title,
1989 msgSuccess = \ 1988 msgSuccess=self.trUtf8("\nMessage catalogs updated successfully."))
1990 self.trUtf8("\nMessage catalogs updated successfully."))
1991 res = dia.startBatchProcesses(argsLists, wd) 1989 res = dia.startBatchProcesses(argsLists, wd)
1992 if res: 1990 if res:
1993 dia.exec_() 1991 dia.exec_()
1994 1992
1995 def updateSelectedCatalogsWithObsolete(self, filenames): 1993 def updateSelectedCatalogsWithObsolete(self, filenames):
2026 E5MessageBox.warning(None, 2024 E5MessageBox.warning(None,
2027 title, 2025 title,
2028 self.trUtf8('No locales detected. Aborting...')) 2026 self.trUtf8('No locales detected. Aborting...'))
2029 return 2027 return
2030 2028
2031 dia = DjangoDialog(title, 2029 dia = DjangoDialog(title,
2032 msgSuccess = \ 2030 msgSuccess=self.trUtf8("\nMessage catalogs updated successfully."))
2033 self.trUtf8("\nMessage catalogs updated successfully."))
2034 res = dia.startBatchProcesses(argsLists, wd) 2031 res = dia.startBatchProcesses(argsLists, wd)
2035 if res: 2032 if res:
2036 dia.exec_() 2033 dia.exec_()
2037 2034
2038 def updateCatalogs(self, filenames): 2035 def updateCatalogs(self, filenames):
2057 title, 2054 title,
2058 self.trUtf8('No current site selected or no site created yet.' 2055 self.trUtf8('No current site selected or no site created yet.'
2059 ' Aborting...')) 2056 ' Aborting...'))
2060 return 2057 return
2061 2058
2062 dia = DjangoDialog(title, 2059 dia = DjangoDialog(title,
2063 msgSuccess = \ 2060 msgSuccess=self.trUtf8("\nMessage catalogs updated successfully."))
2064 self.trUtf8("\nMessage catalogs updated successfully."))
2065 res = dia.startProcess(args, wd) 2061 res = dia.startProcess(args, wd)
2066 if res: 2062 if res:
2067 dia.exec_() 2063 dia.exec_()
2068 2064
2069 def updateCatalogsWithObsolete(self, filenames): 2065 def updateCatalogsWithObsolete(self, filenames):
2087 title, 2083 title,
2088 self.trUtf8('No current site selected or no site created yet.' 2084 self.trUtf8('No current site selected or no site created yet.'
2089 ' Aborting...')) 2085 ' Aborting...'))
2090 return 2086 return
2091 2087
2092 dia = DjangoDialog(title, 2088 dia = DjangoDialog(title,
2093 msgSuccess = \ 2089 msgSuccess=self.trUtf8("\nMessage catalogs updated successfully."))
2094 self.trUtf8("\nMessage catalogs updated successfully."))
2095 res = dia.startProcess(args, wd) 2090 res = dia.startProcess(args, wd)
2096 if res: 2091 if res:
2097 dia.exec_() 2092 dia.exec_()
2098 2093
2099 def compileSelectedCatalogs(self, filenames): 2094 def compileSelectedCatalogs(self, filenames):
2130 E5MessageBox.warning(None, 2125 E5MessageBox.warning(None,
2131 title, 2126 title,
2132 self.trUtf8('No locales detected. Aborting...')) 2127 self.trUtf8('No locales detected. Aborting...'))
2133 return 2128 return
2134 2129
2135 dia = DjangoDialog(title, 2130 dia = DjangoDialog(title,
2136 msgSuccess = \ 2131 msgSuccess=self.trUtf8("\nMessage catalogs compiled successfully."))
2137 self.trUtf8("\nMessage catalogs compiled successfully.")) 2132 res = dia.startBatchProcesses(argsLists, wd, mergedOutput=True)
2138 res = dia.startBatchProcesses(argsLists, wd, mergedOutput = True)
2139 if res: 2133 if res:
2140 dia.exec_() 2134 dia.exec_()
2141 2135
2142 for entry in os.walk(self.__sitePath()): 2136 for entry in os.walk(self.__sitePath()):
2143 for fileName in entry[2]: 2137 for fileName in entry[2]:
2165 title, 2159 title,
2166 self.trUtf8('No current site selected or no site created yet.' 2160 self.trUtf8('No current site selected or no site created yet.'
2167 ' Aborting...')) 2161 ' Aborting...'))
2168 return 2162 return
2169 2163
2170 dia = DjangoDialog(title, 2164 dia = DjangoDialog(title,
2171 msgSuccess = \ 2165 msgSuccess=self.trUtf8("\nMessage catalogs compiled successfully."))
2172 self.trUtf8("\nMessage catalogs compiled successfully.")) 2166 res = dia.startProcess(args, wd, mergedOutput=True)
2173 res = dia.startProcess(args, wd, mergedOutput = True)
2174 if res: 2167 if res:
2175 dia.exec_() 2168 dia.exec_()
2176 2169
2177 for entry in os.walk(self.__sitePath()): 2170 for entry in os.walk(self.__sitePath()):
2178 for fileName in entry[2]: 2171 for fileName in entry[2]:

eric ide

mercurial