[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/src/GBaseApp.py common/src/GConfig....
From: |
James Thompson |
Subject: |
gnue common/src/GBaseApp.py common/src/GConfig.... |
Date: |
Thu, 04 Apr 2002 18:02:32 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 02/04/04 18:02:31
Modified files:
common/src : GBaseApp.py GConfig.py GConnections.py
GDataObjects.py GObjects.py
forms/src/GFObjects: GFBlock.py GFEntry.py
Removed files:
common/src : GConfigParser.py
Log message:
Removed GConfigParser
Added autofillBySequence to <entry> tags
Cleanup and performance improvments
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GBaseApp.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConfig.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConnections.py.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GDataObjects.py.diff?tr1=1.44&tr2=1.45&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GObjects.py.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFObjects/GFBlock.py.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFObjects/GFEntry.py.diff?tr1=1.50&tr2=1.51&r1=text&r2=text
Patches:
Index: gnue/common/src/GBaseApp.py
diff -c gnue/common/src/GBaseApp.py:1.7 gnue/common/src/GBaseApp.py:1.8
*** gnue/common/src/GBaseApp.py:1.7 Tue Mar 19 18:27:00 2002
--- gnue/common/src/GBaseApp.py Thu Apr 4 18:02:31 2002
***************
*** 281,286 ****
--- 281,287 ----
p = pstats.Stats(prof)
p.sort_stats('time').print_stats(50)
p.sort_stats('cumulative').print_stats(50)
+ p.sort_stats('calls').print_stats(50)
Index: gnue/common/src/GConfig.py
diff -c gnue/common/src/GConfig.py:1.9 gnue/common/src/GConfig.py:1.10
*** gnue/common/src/GConfig.py:1.9 Thu Jan 31 00:41:31 2002
--- gnue/common/src/GConfig.py Thu Apr 4 18:02:31 2002
***************
*** 30,36 ****
# HISTORY:
#
! from GConfigParser import *
import os, sys, string
from gnue.common import openResource
import GDebug
--- 30,36 ----
# HISTORY:
#
! from ConfigParser import *
import os, sys, string
from gnue.common import openResource
import GDebug
***************
*** 115,121 ****
def readConfig(self,location):
global _OPTION
! self._parser = GConfigParser()
GDebug.printMesg(1,'Configuration File: "%s"' % location)
drive = os.path.splitdrive(location)
--- 115,121 ----
def readConfig(self,location):
global _OPTION
! self._parser = ConfigParser()
GDebug.printMesg(1,'Configuration File: "%s"' % location)
drive = os.path.splitdrive(location)
Index: gnue/common/src/GConnections.py
diff -c gnue/common/src/GConnections.py:1.29
gnue/common/src/GConnections.py:1.30
*** gnue/common/src/GConnections.py:1.29 Fri Mar 1 23:10:24 2002
--- gnue/common/src/GConnections.py Thu Apr 4 18:02:31 2002
***************
*** 30,36 ****
# HISTORY:
#
! from GConfigParser import *
import sys, string
import GDebug
import GDataObjects
--- 30,36 ----
# HISTORY:
#
! from ConfigParser import *
import sys, string
import GDebug
import GDataObjects
***************
*** 62,68 ****
def __init__(self, location, loginHandler=None):
self._loginHandler = loginHandler
! self._parser = GConfigParser()
self._location = location
GDebug.printMesg(1,'Conn File: "%s"' % location)
--- 62,68 ----
def __init__(self, location, loginHandler=None):
self._loginHandler = loginHandler
! self._parser = ConfigParser()
self._location = location
GDebug.printMesg(1,'Conn File: "%s"' % location)
Index: gnue/common/src/GDataObjects.py
diff -c gnue/common/src/GDataObjects.py:1.44
gnue/common/src/GDataObjects.py:1.45
*** gnue/common/src/GDataObjects.py:1.44 Wed Apr 3 01:18:05 2002
--- gnue/common/src/GDataObjects.py Thu Apr 4 18:02:31 2002
***************
*** 489,495 ****
# Returns 1=Field is bound to a database field
def isFieldBound(self, fieldName):
! return self._dataObject._fieldReferences.has_key(string.lower(fieldName))
###
--- 489,499 ----
# Returns 1=Field is bound to a database field
def isFieldBound(self, fieldName):
! try:
! return self._dataObject._fieldReferences.has_key(fieldName)
! except:
! GDebug.printMesg(0,'I should never run')
! return
self._dataObject._fieldReferences.has_key(string.lower(fieldName))
###
***************
*** 583,592 ****
# Returns current value of "field"
def getField(self, field):
! if self._fields.has_key(string.lower(field)):
! return self._fields[string.lower(field)]
! else:
! return None
# Sets current value of "field"
--- 587,602 ----
# Returns current value of "field"
def getField(self, field):
! try:
! return self._fields[field]
! except KeyError:
! try:
! # TODO: something odd here
! #GDebug.printMesg(0,'I should never run %s' % field)
! #print self._fields
! return self._fields[string.lower(field)]
! except KeyError:
! return None
# Sets current value of "field"
***************
*** 618,624 ****
# Returns 1=Field has been modified
def isFieldModified(self, fieldName):
! return self._modifiedFlags.has_key (string.lower(fieldName))
# Mark the current record as deleted
--- 628,638 ----
# Returns 1=Field has been modified
def isFieldModified(self, fieldName):
! try:
! return self._modifiedFlags.has_key (fieldName)
! except KeyError:
! GDebug.printMesg(0,'I should never run')
! return self._modifiedFlags.has_key (string.lower(fieldName))
# Mark the current record as deleted
Index: gnue/common/src/GObjects.py
diff -c gnue/common/src/GObjects.py:1.30 gnue/common/src/GObjects.py:1.31
*** gnue/common/src/GObjects.py:1.30 Wed Apr 3 01:18:05 2002
--- gnue/common/src/GObjects.py Thu Apr 4 18:02:31 2002
***************
*** 73,86 ****
self._phaseInit(phase)
def _phaseInit(self,phase):
! if (len(self._inits) > phase) and (self._inits[phase] != None):
GDebug.printMesg(6,"%s: Init Phase %s" % (self._type, phase+1))
self._inits[phase]()
! if self._children:
! for child in self._children:
! if isinstance(child, GObj):
! child._phaseInit(phase)
#
--- 73,85 ----
self._phaseInit(phase)
def _phaseInit(self,phase):
! if (len(self._inits) > phase) and self._inits[phase]:
GDebug.printMesg(6,"%s: Init Phase %s" % (self._type, phase+1))
self._inits[phase]()
! for child in self._children:
! if isinstance(child, GObj):
! child._phaseInit(phase)
#
Index: gnue/forms/src/GFObjects/GFBlock.py
diff -c gnue/forms/src/GFObjects/GFBlock.py:1.43
gnue/forms/src/GFObjects/GFBlock.py:1.44
*** gnue/forms/src/GFObjects/GFBlock.py:1.43 Wed Apr 3 01:18:06 2002
--- gnue/forms/src/GFObjects/GFBlock.py Thu Apr 4 18:02:31 2002
***************
*** 74,81 ****
# Trigger exposure
#
self._triggerGlobal = 1
!
self._triggerFunctions={'autofillBySequence':{'function':self.triggerAutofillBySequence},
! 'clear':{'function':self.processClear},
'gotoRecord':{'function':self.jumpRecord},
'newRecord':{'function':self.newRecord},
}
--- 74,80 ----
# Trigger exposure
#
self._triggerGlobal = 1
! self._triggerFunctions={'clear':{'function':self.processClear},
'gotoRecord':{'function':self.jumpRecord},
'newRecord':{'function':self.newRecord},
}
***************
*** 93,112 ****
raise IndexError
return self
-
- def triggerAutofillBySequence(self,fieldName,sequenceName):
- # Find the datasource field name bound to the named entry
- entry=""
- for item in self._entryList:
- if item.name == string.lower(fieldName):
- entry = item.field
- break
-
- for count in range(self._resultSet.getRecordCount()):
- if (not self._resultSet.getRecord(count).getField(entry)) or \
- self._resultSet.getRecord(count).getField(entry)=="":
- sequenceNumber =
self._dataSourceLink._dataObject.triggerExtensions.getSequence(sequenceName)
- self._resultSet.getRecord(count).setField(entry, sequenceNumber)
def _buildObject(self):
--- 92,97 ----
Index: gnue/forms/src/GFObjects/GFEntry.py
diff -c gnue/forms/src/GFObjects/GFEntry.py:1.50
gnue/forms/src/GFObjects/GFEntry.py:1.51
*** gnue/forms/src/GFObjects/GFEntry.py:1.50 Wed Apr 3 21:10:34 2002
--- gnue/forms/src/GFObjects/GFEntry.py Thu Apr 4 18:02:31 2002
***************
*** 70,77 ****
#
# Trigger exposure
#
! self._triggerFunctions={'allowedValues':{'function':self.allowedValues,
! },
}
self._triggerProperties={'readonly':{'set':self.setReadonly,
'get':self.getReadonly
--- 70,77 ----
#
# Trigger exposure
#
! self._triggerFunctions={'allowedValues':{'function':self.allowedValues,},
!
'autofillBySequence':{'function':self.triggerAutofillBySequence},
}
self._triggerProperties={'readonly':{'set':self.setReadonly,
'get':self.getReadonly
***************
*** 79,84 ****
--- 79,91 ----
}
self._triggerSet = self.setValue
self._triggerGet = self.getValue
+
+
+ def triggerAutofillBySequence(self,sequenceName):
+ if (not self.getValue()) or self.getValue()=="":
+ sequenceNumber =
self._block._dataSourceLink._dataObject.triggerExtensions.getSequence(sequenceName)
+ self.setValue(sequenceNumber)
+
def getReadonly(self):
return self.readonly
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue common/src/GBaseApp.py common/src/GConfig....,
James Thompson <=