[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7033 - trunk/gnue-forms/src
From: |
reinhard |
Subject: |
[gnue] r7033 - trunk/gnue-forms/src |
Date: |
Tue, 15 Feb 2005 17:10:53 -0600 (CST) |
Author: reinhard
Date: 2005-02-15 17:10:52 -0600 (Tue, 15 Feb 2005)
New Revision: 7033
Modified:
trunk/gnue-forms/src/GFClient.py
trunk/gnue-forms/src/GFDisplayHandler.py
trunk/gnue-forms/src/GFForm.py
trunk/gnue-forms/src/GFInstance.py
Log:
Added some debug messages that might help to speed up form startup.
Modified: trunk/gnue-forms/src/GFClient.py
===================================================================
--- trunk/gnue-forms/src/GFClient.py 2005-02-15 23:08:20 UTC (rev 7032)
+++ trunk/gnue-forms/src/GFClient.py 2005-02-15 23:10:52 UTC (rev 7033)
@@ -93,7 +93,11 @@
def run (self):
+ gBeginFunc (4)
+
# Initialize user interface
+ gDebug (4, "Loading user interface driver")
+
self.ui_type = self.OPTIONS ['user_interface']
if self.ui_type:
SPECIFIC_UI = True
@@ -129,6 +133,8 @@
raise StartupError, u_("Unable to load UI driver: %s") % err
# Get the user supplied parameters
+ gDebug (4, "Parsing command line parameters")
+
userParameters = self.getCommandLineParameters (self.ARGUMENTS [1:])
if gConfigForms ('disableSplash') == True:
@@ -137,6 +143,8 @@
self.disableSplash = self.OPTIONS['no-splash']
# Create the instance that will control the loaded form(s)
+ gDebug (4, "Creating GFInstance object")
+
instance = GFInstance (self, self.connections, self._ui,
self.disableSplash, userParameters)
@@ -167,13 +175,21 @@
else:
raise StartupError, u_("No Forms Definition File Specified.")
+ gDebug (4, "Parsing form definition")
instance.addFormFromFile (formfile)
+
+ gDebug (4, "Parsing standard dialogs")
instance.addDialogs ()
+
+ gDebug (4, "Activating form")
instance.activate ()
+ gDebug (4, "Closing all connections")
self.getConnectionManager ().closeAll ()
+ gEndFunc (4)
+
# ---------------------------------------------------------------------------
# List all available user interfaces
# ---------------------------------------------------------------------------
Modified: trunk/gnue-forms/src/GFDisplayHandler.py
===================================================================
--- trunk/gnue-forms/src/GFDisplayHandler.py 2005-02-15 23:08:20 UTC (rev
7032)
+++ trunk/gnue-forms/src/GFDisplayHandler.py 2005-02-15 23:10:52 UTC (rev
7033)
@@ -89,7 +89,7 @@
def generateRefreshEvent(self):
- GDebug.printMesg (4, "generateRefreshEvent on %s '%s' %s" % \
+ gDebug (5, "generateRefreshEvent on %s '%s' %s" % \
(self, self.display, self.entry))
# TODO: this should probably actually happen in UIwxpython!
if (self.handleCR and type(self.display)=='str'):
Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py 2005-02-15 23:08:20 UTC (rev 7032)
+++ trunk/gnue-forms/src/GFForm.py 2005-02-15 23:10:52 UTC (rev 7033)
@@ -274,7 +274,7 @@
"""
if object._type == 'GFField':
- gDebug (4, "GFField was passed to 'findFocus'.")
+ gDebug (5, "GFField was passed to 'findFocus'.")
try:
object = object._entryList[0]
except IndexError:
@@ -338,12 +338,12 @@
# cannot change focus to same entry
if widget == self._currentEntry:
- gDebug (4, "Widget is current entry %s" % widget)
+ gDebug (5, "Widget is current entry %s" % widget)
return
cen = self._currentEntry is not None and self._currentEntry.name or '-'
win = widget is not None and widget.name or '-'
- gDebug (4, "Changing focus from %s (%s) to %s (%s)" % \
+ gDebug (5, "Changing focus from %s (%s) to %s (%s)" % \
(self._currentEntry, cen, widget, win))
try:
@@ -410,7 +410,7 @@
if blockChange:
self.refreshDisplay(self._currentBlock)
- gDebug (4, "Updating entries old: %s, new: %s" % \
+ gDebug (5, "Updating entries old: %s, new: %s" % \
(oldEntry, self._currentEntry))
self.dispatchEvent('updateENTRY', oldEntry, _form=self)
@@ -433,12 +433,12 @@
if pageChange:
self._currentPage.processTrigger('Post-FocusIn', ignoreAbort=False)
- gDebug (4, "calling refreshUIEvents ()")
+ gDebug (5, "calling refreshUIEvents ()")
self.refreshUIEvents()
- gDebug (4, "CurrentEntry is %s" % self._currentEntry)
+ gDebug (5, "CurrentEntry is %s" % self._currentEntry)
except AbortRequest, t:
- gDebug (4, "Trigger Error!")
+ gDebug (5, "Trigger Error!")
message = _("Trigger Exception :\n") + t.message
return message
@@ -517,7 +517,7 @@
block.processRollback()
for entry in block._entryList:
if hasattr(entry, 'queryDefault'):
- gDebug (4, "%s will be set to %s" % (entry.name, entry.queryDefault))
+ gDebug (5, "%s will be set to %s" % (entry.name, entry.queryDefault))
entry.setValue(entry.queryDefault)
# If Enter-Query is hit once, enter query mode
@@ -636,18 +636,18 @@
self.processTrigger ('Pre-Commit', ignoreAbort = False)
except AbortRequest:
- gDebug (4, "Trigger form Pre-Commit threw a AbortRequest!")
+ gDebug (5, "Trigger form Pre-Commit threw a AbortRequest!")
return _("Form trigger returned error")
# Process the commit on all blocks
for block in self._logic._blockList:
- gDebug (4, "Saving %s" % block.name)
+ gDebug (5, "Saving %s" % block.name)
try:
block.processCommit ()
except AbortRequest:
- gDebug (4, "Trigger block Pre-Commit threw a AbortRequest!")
+ gDebug (5, "Trigger block Pre-Commit threw a AbortRequest!")
return _("Block trigger returned error")
# Now do the real commit () on the backend connections (only once per
@@ -664,7 +664,7 @@
block.processClear ()
else:
- gDebug (4, "switchRecord (0) from commit")
+ gDebug (5, "switchRecord (0) from commit")
block.switchRecord (0)
self.dispatchEvent ('cannotCOMMIT')
Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py 2005-02-15 23:08:20 UTC (rev 7032)
+++ trunk/gnue-forms/src/GFInstance.py 2005-02-15 23:10:52 UTC (rev 7033)
@@ -74,7 +74,11 @@
def __init__ (self, manager, connections, ui, disableSplash = False,
parameters = {}, parentContainer = None):
+ gBeginFunc (4)
+
# Configure event handling
+ gDebug (4, "Initializing event handling")
+
self.eventController = events.EventController ()
events.EventAware.__init__ (self, self.eventController)
self.registerEventListeners ({
@@ -156,11 +160,14 @@
# Construct an instance of the UI driver if an UI module is available
if self._uimodule is not None:
+ gDebug (4, "Initializing user interface driver")
self._uiinstance = self._uimodule.GFUserInterface (self.eventController,
disableSplash = self._disableSplash,
parentContainer = self._parentContainer)
+ gEndFunc (4, hasResult = False)
+
# ---------------------------------------------------------------------------
# Add the basic dialogs
# ---------------------------------------------------------------------------
@@ -292,7 +299,10 @@
def activate (self):
+ gBeginFunc (4)
+
# Initialize all the forms loaded into memory
+ gDebug (4, "Initializing form objects")
try:
for formObject in self._formsDictionary.values ():
formObject.phaseInit ()
@@ -306,9 +316,11 @@
u_("Error while communicating with datasource: %s") \
% errors.getException () [2]
+ gDebug (4, "Initializing user interface driver object")
self._uiinstance.initialize ()
# Build the UIs for all the forms
+ gDebug (4, "Building forms")
for dialog in self._formsDictionary.keys ():
self.buildForm (dialog)
@@ -319,21 +331,26 @@
# we assume a dialog to be modal by definition and that program execution
# stops here until the dialog get's closed. So do *not* enter another
# main loop
+ gDebug (4, "Activating main form as dialog")
self.activateForm ('__main__', modal = True)
else:
+ gDebug (4, "Activating main form")
self.activateForm ('__main__')
+
+ gDebug (4, "Startup complete")
+ gDebug (4, "Entering main loop")
self._uiinstance.mainLoop ()
-
-
# ---------------------------------------------------------------------------
# Activate a given form
# ---------------------------------------------------------------------------
def activateForm (self, formName = '__main__', parameters = {}, modal = 0):
+ gBeginFunc (4)
+
form = self._formsDictionary [formName]
if len (parameters.keys ()):
@@ -353,7 +370,9 @@
self.dispatchEvent ('gotoENTRY', object = form._currentEntry, _form = form)
self._uiinstance.activateForm (formName, modal)
+ gEndFunc (4, hasResult = False)
+
# ---------------------------------------------------------------------------
# Build a user interface for a form tree
# ---------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7033 - trunk/gnue-forms/src,
reinhard <=