commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue common/src/dbdrivers/_dbsig/DBdriver.py de...


From: Jason Cater
Subject: gnue common/src/dbdrivers/_dbsig/DBdriver.py de...
Date: Wed, 23 Jan 2002 11:36:35 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/23 11:36:34

Modified files:
        common/src/dbdrivers/_dbsig: DBdriver.py 
        designer/src   : TemplateParser.py 

Log message:
        fixed some issues related to non-PG drivers

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/_dbsig/DBdriver.py.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/TemplateParser.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: gnue/common/src/dbdrivers/_dbsig/DBdriver.py
diff -c gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.33 
gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.34
*** gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.33   Thu Jan 10 17:42:19 2002
--- gnue/common/src/dbdrivers/_dbsig/DBdriver.py        Wed Jan 23 11:36:34 2002
***************
*** 133,144 ****
             self,dataObject,cursor,defaultValues,masterRecordSet)
      self._recordSetClass = DBSIG_RecordSet
      self._fieldNames = []
!     
      if self._cursor:
        for t in(self._cursor.description):
          self._fieldNames.append(t[0])
        GDebug.printMesg(5, "Field names set to %s" % self._fieldNames)
!                 
      self._recordCount = cursor.rowcount or 0
  
      # If a DB driver supports a unique identifier for rows,
--- 133,144 ----
             self,dataObject,cursor,defaultValues,masterRecordSet)
      self._recordSetClass = DBSIG_RecordSet
      self._fieldNames = []
! 
      if self._cursor:
        for t in(self._cursor.description):
          self._fieldNames.append(t[0])
        GDebug.printMesg(5, "Field names set to %s" % self._fieldNames)
! 
      self._recordCount = cursor.rowcount or 0
  
      # If a DB driver supports a unique identifier for rows,
***************
*** 171,177 ****
              i = 0
              dict = {}
              for f in (rs):
!               dict[self._fieldNames[i]] = f
                i += 1
              self._cachedRecords.append (self._recordSetClass(parent=self, \
                                                               
initialData=dict))
--- 171,177 ----
              i = 0
              dict = {}
              for f in (rs):
!               dict[string.lower(self._fieldNames[i])] = f
                i += 1
              self._cachedRecords.append (self._recordSetClass(parent=self, \
                                                               
initialData=dict))
***************
*** 230,244 ****
  
        cursor.arraysize = self.cache
        cursor.execute(self._buildQuery(conditions))
!       
!     except self._DatabaseError, err: 
        raise GDataObjects.ConnectionError, err
      rs = self._resultSetClass(self, cursor=cursor, 
masterRecordSet=masterRecordSet)
      if self._strictQueryCount:
        rs._recordCount = recordCount
!     if readOnly: 
        rs._readonly = readOnly
!     
      return rs
  
    def _getQueryCount(self,conditions={}):
--- 230,244 ----
  
        cursor.arraysize = self.cache
        cursor.execute(self._buildQuery(conditions))
! 
!     except self._DatabaseError, err:
        raise GDataObjects.ConnectionError, err
      rs = self._resultSetClass(self, cursor=cursor, 
masterRecordSet=masterRecordSet)
      if self._strictQueryCount:
        rs._recordCount = recordCount
!     if readOnly:
        rs._readonly = readOnly
! 
      return rs
  
    def _getQueryCount(self,conditions={}):
***************
*** 246,252 ****
  
      cursor.execute(self._buildQueryCount(conditions))
      rs = cursor.fetchone()
!     return rs[0]
  
    def commit(self):
      GDebug.printMesg (5,"DB-SIG database driver: commit()")
--- 246,252 ----
  
      cursor.execute(self._buildQueryCount(conditions))
      rs = cursor.fetchone()
!     return int(rs[0])
  
    def commit(self):
      GDebug.printMesg (5,"DB-SIG database driver: commit()")
***************
*** 261,269 ****
    def rollback(self):
      GDebug.printMesg (5,"DB-SIG database driver: rollback()")
  
!     try: 
        self._dataConnection.rollback()
!     except: 
        pass    # I'm SURE this isn't right (jcater)
                  # But not all db's support transactions
  
--- 261,269 ----
    def rollback(self):
      GDebug.printMesg (5,"DB-SIG database driver: rollback()")
  
!     try:
        self._dataConnection.rollback()
!     except:
        pass    # I'm SURE this isn't right (jcater)
                  # But not all db's support transactions
  
Index: gnue/designer/src/TemplateParser.py
diff -c gnue/designer/src/TemplateParser.py:1.7 
gnue/designer/src/TemplateParser.py:1.8
*** gnue/designer/src/TemplateParser.py:1.7     Sun Nov  4 12:06:14 2001
--- gnue/designer/src/TemplateParser.py Wed Jan 23 11:36:34 2002
***************
*** 106,116 ****
      w = w - 50
      h = h - 56 - self.title.GetSize().y - self.nextButton.GetSize().y
      self.wizardPage.SetSize((w,h))
      self.wizardPage.SetBackgroundColour(
          wxColour(
!           self.panel.GetBackgroundColour().Red() + 32,
!           self.panel.GetBackgroundColour().Green() + 32,
!           self.panel.GetBackgroundColour().Blue() + 32) )
  
      self.wizardPage.setStep(self.template.FIRST_STEP)
      completed = self.wizard.ShowModal()
--- 106,121 ----
      w = w - 50
      h = h - 56 - self.title.GetSize().y - self.nextButton.GetSize().y
      self.wizardPage.SetSize((w,h))
+ 
+     r = self.panel.GetBackgroundColour().Red()
+     g = self.panel.GetBackgroundColour().Green()
+     b = self.panel.GetBackgroundColour().Blue()
+ 
      self.wizardPage.SetBackgroundColour(
          wxColour(
!           (r <= 223 and r or 223) + 32,
!           (g <= 223 and g or 223) + 32,
!           (b <= 223 and b or 223) + 32) )
  
      self.wizardPage.setStep(self.template.FIRST_STEP)
      completed = self.wizard.ShowModal()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]