commit-gnue
[Top][All Lists]
Advanced

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

gnue/reports/src GRDataMapper.py GRLayout.py GR...


From: Jason Cater
Subject: gnue/reports/src GRDataMapper.py GRLayout.py GR...
Date: Sun, 20 Oct 2002 22:16:02 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/10/20 22:16:02

Modified files:
        reports/src    : GRDataMapper.py GRLayout.py GRReport.py 

Log message:
        fixed calculations of summaries

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRDataMapper.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRLayout.py.diff?cvsroot=OldCVS&tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRReport.py.diff?cvsroot=OldCVS&tr1=1.22&tr2=1.23&r1=text&r2=text

Patches:
Index: gnue/reports/src/GRDataMapper.py
diff -c gnue/reports/src/GRDataMapper.py:1.17 
gnue/reports/src/GRDataMapper.py:1.18
*** gnue/reports/src/GRDataMapper.py:1.17       Tue Aug 27 11:53:01 2002
--- gnue/reports/src/GRDataMapper.py    Sun Oct 20 22:16:02 2002
***************
*** 61,66 ****
--- 61,68 ----
      self.datasource = None
      self._resultsets = []
  
+     self._clearOnNextSet = 0
+ 
      self._summMap = {'sum': self._summ_sum,
                       'count': self._summ_count,
                       'avg': self._summ_avg,
***************
*** 142,147 ****
--- 144,150 ----
      for field in self.summaries.keys():
        for function in self.summaries[field].keys():
          self.summaries[field][function] = None
+     self._clearOnNextSet = 0
  
  
    #
***************
*** 166,172 ****
--- 169,178 ----
    #
    # Initiate the calculation of summaries
    #
+   # TODO: I **SERIOUSLY** don't think this is being used any longer
    def _handleSummary(self):
+     if self._clearOnNextSet:
+       self.clearSummaries()
      # Now, calc all summaries
      for field in self.summaries.keys():
        for function in _summFunctions:
***************
*** 372,377 ****
--- 378,386 ----
            s.fields[field] = recordset.getField(field)
  
          # ... and save any new summary data
+         if s._clearOnNextSet:
+           s.clearSummaries()
+ 
          for field in s.summaries.keys():
            for function in _summFunctions:
              if s.summaries[field].has_key(function):
Index: gnue/reports/src/GRLayout.py
diff -c gnue/reports/src/GRLayout.py:1.39 gnue/reports/src/GRLayout.py:1.40
*** gnue/reports/src/GRLayout.py:1.39   Mon Sep 16 15:22:15 2002
--- gnue/reports/src/GRLayout.py        Sun Oct 20 22:16:02 2002
***************
*** 195,203 ****
        structuralComment = _structuralComment
  
      for child in self._children:
!       structuralComment(dest, '<!--[layout]-->')
        child.processAsController(dest, self._mapper)
!       structuralComment(dest, '<!--[/layout]-->\n')
  
  
  
--- 195,203 ----
        structuralComment = _structuralComment
  
      for child in self._children:
!       structuralComment(dest, '<!-- [layout] -->')
        child.processAsController(dest, self._mapper)
!       structuralComment(dest, '<!-- [/layout] -->\n')
  
  
  
***************
*** 397,413 ****
    # Generic process() method.  Process the
    # current record and handle any children.
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     
      GDebug.printMesg(10,"Repeating Section %s" % self._name)
!     structuralComment(dest,"<!--[section:%s]-->" % self._name)
      nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
!     
      try:
!       mapper.sectionMap[self.name].clearSummaries()
      except KeyError:
        pass
  
!     structuralComment(dest,"<!--[/section:%s]-->" % self._name)
      GDebug.printMesg(10,"Leaving section %s" % self._name)
      return nextSection
  
--- 397,415 ----
    # Generic process() method.  Process the
    # current record and handle any children.
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
! 
      GDebug.printMesg(10,"Repeating Section %s" % self._name)
!     structuralComment(dest,"<!-- [section:%s] -->" % self._name)
      nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
! 
      try:
! 
!       structuralComment(dest,"<!-- [Setting %s to clear on next set] -->" % 
self._name)
!       mapper.sectionMap[self.name]._clearOnNextSet = 1
      except KeyError:
        pass
  
!     structuralComment(dest,"<!-- [/section:%s] -->" % self._name)
      GDebug.printMesg(10,"Leaving section %s" % self._name)
      return nextSection
  
***************
*** 427,437 ****
      self._mymapper = None
  
    def processDefault(self, dest, mapper):
!     structuralComment(dest,"<!--[default]-->")
      for child in self._children:
        if child._type == "_content_":
          dest.write(child.getContent())
!     structuralComment(dest,"<!--[/default]-->")
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      return nextSection
--- 429,439 ----
      self._mymapper = None
  
    def processDefault(self, dest, mapper):
!     structuralComment(dest,"<!-- [default] -->")
      for child in self._children:
        if child._type == "_content_":
          dest.write(child.getContent())
!     structuralComment(dest,"<!-- [/default] -->")
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      return nextSection
***************
*** 449,458 ****
      self.format = None
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!--[field:%s]-->" % self.name)
      dest.write (string.replace(saxutils.escape("%s" % 
self._mymapper.getField(self.name,
                                                self.format)), '\r',''))
!     structuralComment(dest,"<!--[/field:%s]-->" % self.name)
      return nextSection
  
  
--- 451,460 ----
      self.format = None
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!-- [field:%s] -->" % self.name)
      dest.write (string.replace(saxutils.escape("%s" % 
self._mymapper.getField(self.name,
                                                self.format)), '\r',''))
!     structuralComment(dest,"<!-- [/field:%s] -->" % self.name)
      return nextSection
  
  
***************
*** 478,486 ****
      return GRLayoutElement._buildObject(self)
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!--[summ:%s]-->" % self.name)
      dest.write (self._mymapper.getSummary(self._field, self.function, 
self.format))
!     structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
      return nextSection
  
  
--- 480,488 ----
      return GRLayoutElement._buildObject(self)
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!-- [summ:%s:%s:%s] -->" % (self.section, 
self._field, self.function))
      dest.write (self._mymapper.getSummary(self._field, self.function, 
self.format))
!     structuralComment(dest,"<!-- [/summ] -->")
      return nextSection
  
  
***************
*** 500,508 ****
      GRStubParam.__init__(self, parent)
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!--[param:%s]-->" % self.name)
      dest.write (self.getFormattedValue())
!     structuralComment(dest,"<!--[/param:%s]-->" % self.name)
      return nextSection
  
  
--- 502,510 ----
      GRStubParam.__init__(self, parent)
  
    def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     structuralComment(dest,"<!-- [param:%s] -->" % self.name)
      dest.write (self.getFormattedValue())
!     structuralComment(dest,"<!-- [/param:%s] -->" % self.name)
      return nextSection
  
  
Index: gnue/reports/src/GRReport.py
diff -c gnue/reports/src/GRReport.py:1.22 gnue/reports/src/GRReport.py:1.23
*** gnue/reports/src/GRReport.py:1.22   Sun Apr 28 21:52:53 2002
--- gnue/reports/src/GRReport.py        Sun Oct 20 22:16:02 2002
***************
*** 12,18 ****
  # PURPOSE. See the GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public
! # License along with program; see the file COPYING. If not, 
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
--- 12,18 ----
  # PURPOSE. See the GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public
! # License along with program; see the file COPYING. If not,
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
***************
*** 30,35 ****
--- 30,36 ----
  #
  
  from gnue.common.GObjects import *
+ from gnue.common.GRootObj import GRootObj
  from gnue.common import GDebug
  import sys
  import GRParser
***************
*** 40,48 ****
  import GRExceptions
  
  
! class GRReport(GObj):
    def __init__(self, parent=None):
      GObj.__init__(self, parent, type='GRReport')
      self._connections = None  # This will be set by GRParser.loadReport
      self._inits = (self.initialize,self.postInit)
      self._datasourceDictionary = {}
--- 41,50 ----
  import GRExceptions
  
  
! class GRReport(GObj, GRootObj):
    def __init__(self, parent=None):
      GObj.__init__(self, parent, type='GRReport')
+     GRootObj.__init__(self, 'report')
      self._connections = None  # This will be set by GRParser.loadReport
      self._inits = (self.initialize,self.postInit)
      self._datasourceDictionary = {}




reply via email to

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