commit-gnue
[Top][All Lists]
Advanced

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

gnue/reports samples/foobulations/monthly.grd s...


From: Jason Cater
Subject: gnue/reports samples/foobulations/monthly.grd s...
Date: Mon, 08 Apr 2002 22:41:02 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/04/08 22:41:02

Modified files:
        reports/samples/foobulations: monthly.grd 
        reports/src    : GRLayout.py 

Log message:
        more work on the layout processes; still issues w/firstRow

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/samples/foobulations/monthly.grd.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRLayout.py.diff?cvsroot=OldCVS&tr1=1.22&tr2=1.23&r1=text&r2=text

Patches:
Index: gnue/reports/samples/foobulations/monthly.grd
diff -c gnue/reports/samples/foobulations/monthly.grd:1.6 
gnue/reports/samples/foobulations/monthly.grd:1.7
*** gnue/reports/samples/foobulations/monthly.grd:1.6   Mon Apr  8 12:03:19 2002
--- gnue/reports/samples/foobulations/monthly.grd       Mon Apr  8 22:41:02 2002
***************
*** 36,42 ****
                  <out:col><field name="foobs"/></out:col>
              </out:row>
            </section>
!           <out:subtotal/>
            <default>
              <out:row>
                <out:col>(No results to display)</out:col>
--- 36,46 ----
                  <out:col><field name="foobs"/></out:col>
              </out:row>
            </section>
!           <out:subtotalRow level="2">  <!-- TODO: Replace w/summs once they 
work -->
!             <out:subtotal skip=""/>
!             <out:subtotal skip=""/>
!             <out:subtotal>12</out:subtotal>
!           </out:subtotalRow>
            <default>
              <out:row>
                <out:col>(No results to display)</out:col>
***************
*** 45,50 ****
--- 49,60 ----
              </out:row>
            </default>
          </section>
+         <out:subtotalRow level="1">
+           <out:total skip=""/>
+           <out:total skip=""/>
+           <out:total>36</out:total>
+         </out:subtotalRow>
+ 
  
        </out:table>
      </out:section>
Index: gnue/reports/src/GRLayout.py
diff -c gnue/reports/src/GRLayout.py:1.22 gnue/reports/src/GRLayout.py:1.23
*** gnue/reports/src/GRLayout.py:1.22   Mon Apr  8 18:01:50 2002
--- gnue/reports/src/GRLayout.py        Mon Apr  8 22:41:02 2002
***************
*** 200,206 ****
      self._inits = [self.primaryInit]
  
    # Called if section contains data
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      return nextSection
  
    def primaryInit(self):
--- 200,206 ----
      self._inits = [self.primaryInit]
  
    # Called if section contains data
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      return nextSection
  
    def primaryInit(self):
***************
*** 221,238 ****
  class ContainerElement (GRLayoutElement):
    def __init__(self, parent=None, type='GRContainerElement'):
      GRLayoutElement.__init__(self, parent, type=type)
  
  
    # Process all children, handling GRSections properly
    def processChildren(self, dest, mapper,
!                       isfirst, firstSection, nextSection):
!     try:
!       print ">>>>in %s" % self._name
!     except:
!       pass
      while 1:
        for child in self._children:
-         print "handling child %s" % child._type
          if child._type == "_content_":
            dest.write(child.getContent())
          else:
--- 221,236 ----
  class ContainerElement (GRLayoutElement):
    def __init__(self, parent=None, type='GRContainerElement'):
      GRLayoutElement.__init__(self, parent, type=type)
+     self._name = None
  
  
    # Process all children, handling GRSections properly
    def processChildren(self, dest, mapper,
!                       isfirst, islast, firstSection, nextSection):
! 
!     first = 1 # isfirst or firstSection == self
      while 1:
        for child in self._children:
          if child._type == "_content_":
            dest.write(child.getContent())
          else:
***************
*** 241,280 ****
                GDebug.printMesg(10, "Calling new controlling section")
                child.processAsController(dest, mapper)
              else:
!               nextSection = child.process(dest, mapper, 1, firstSection, 
nextSection)
!               # If we are repeating on our section, then go no further until 
we're done
!               print "nextSection after child = %s" % nextSection._name
!             try:
!               print "returning %s" % nextSection._name
!             except:
!               print "returning %s" % nextSection
  
            else:
!             nextSection = child.process(dest, mapper, isfirst, firstSection, 
nextSection)
!             try:
!               print "subNextSection = %s" % nextSection._name
!             except:
!               print "subNextSection = %s" % nextSection
! 
  
!       if nextSection != self:
!         try:
!           print "breaking from %s; nextSection=%s" % (self._name, 
nextSection._name)
!         except:
!           try:
!             print "breaking from %s; nextSection=%s" % (self._name, None)
!           except:
!             print "breaking from %s" % 
string.split(string.split(str(self))[0],'.')[1]
  
!         break
!       else:
!         print "calling gotos"
          firstSection, nextSection = self.getGotos(mapper)
  
-     try:
-       print "<<<<out %s" % self._name
-     except:
-       print "<<<<out"
      return nextSection
  
  
--- 239,264 ----
                GDebug.printMesg(10, "Calling new controlling section")
                child.processAsController(dest, mapper)
              else:
!               nextSection = child.process(dest, mapper,
!                  isfirst=first,
!                  islast=(nextSection == None) or \
!                     (nextSection._name not in (child._childSections)),
!                  firstSection=firstSection,
!                  nextSection=nextSection)
  
            else:
!             nextSection = child.process(dest, mapper, first, islast,
!                                         firstSection, nextSection)
  
!       first = 0
  
!       if nextSection == self:
          firstSection, nextSection = self.getGotos(mapper)
+         #print "grabbing next one %s" % self._name
+         islast = (nextSection == None)
+       else:
+         break
  
      return nextSection
  
  
***************
*** 327,333 ****
        # This is a dataless section...
        # simply process it's children
  
!       self.process(dest, mapper, 1, None, None)
  
      else:
        if mapper.getFirstRecord(self._source):
--- 311,317 ----
        # This is a dataless section...
        # simply process it's children
  
!       self.process(dest, mapper, 1, 1, None, None)
  
      else:
        if mapper.getFirstRecord(self._source):
***************
*** 336,343 ****
  
          firstSection, nextSection = self.getGotos(mapper,1)
  
!         print "nextSection = %s" % nextSection
!         self.process(dest, mapper, 1, self, nextSection)
  #
  #        oldSection = None
  #
--- 320,326 ----
  
          firstSection, nextSection = self.getGotos(mapper,1)
  
!         self.process(dest, mapper, 1, nextSection == None, self, nextSection)
  #
  #        oldSection = None
  #
***************
*** 374,380 ****
    # Used internally to determine next section to move
    #
    def getGotos(self, mapper, first=0):
-     print "getGotos()  [%s]" % self._name
      # Determine the next section to process our data.
      # (i.e., handle section grouping)
      if first:
--- 357,362 ----
***************
*** 389,399 ****
      else:
        nextSection = None
  
-     try:
-       print "goto=%s; next=%s" % (firstSection._name, nextSection._name)
-     except:
-       print "goto=%s; next=%s" % (firstSection._name, None)
- 
      # And return them
      return (firstSection, nextSection)
  
--- 371,376 ----
***************
*** 412,422 ****
  
    # Generic process() method.  Process the
    # current record and handle any children.
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
  
      GDebug.printMesg(10,"Repeating Section %s" % self._name)
      structuralComment(dest,"<!--[section:%s]-->" % self._name)
!     nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
      structuralComment(dest,"<!--[/section:%s]-->" % self._name)
      GDebug.printMesg(10,"Leaving section %s" % self._name)
      return nextSection
--- 389,399 ----
  
    # 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)
      structuralComment(dest,"<!--[/section:%s]-->" % self._name)
      GDebug.printMesg(10,"Leaving section %s" % self._name)
      return nextSection
***************
*** 443,449 ****
          dest.write(child.getContent())
      structuralComment(dest,"<!--[/default]-->")
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      return nextSection
  
  
--- 420,426 ----
          dest.write(child.getContent())
      structuralComment(dest,"<!--[/default]-->")
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      return nextSection
  
  
***************
*** 458,464 ****
      self._section = None
      self.format = None
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      structuralComment(dest,"<!--[field:%s]-->" % self.name)
      dest.write (self._mymapper.getField(self.name, self.format))
      structuralComment(dest,"<!--[/field:%s]-->" % self.name)
--- 435,441 ----
      self._section = None
      self.format = None
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      structuralComment(dest,"<!--[field:%s]-->" % self.name)
      dest.write (self._mymapper.getField(self.name, self.format))
      structuralComment(dest,"<!--[/field:%s]-->" % self.name)
***************
*** 477,483 ****
      self.function = "count"
      self.format = None
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      structuralComment(dest,"<!--[summ:%s]-->" % self.name)
      dest.write (self._mymapper.getSummary(self.name, self.function, 
self.format))
      structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
--- 454,460 ----
      self.function = "count"
      self.format = None
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      structuralComment(dest,"<!--[summ:%s]-->" % self.name)
      dest.write (self._mymapper.getSummary(self.name, self.function, 
self.format))
      structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
***************
*** 496,502 ****
      GRLayoutElement.__init__(self, parent)
      GRStubParam.__init__(self, parent)
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      structuralComment(dest,"<!--[param:%s]-->" % self.name)
      dest.write (self.getFormattedValue())
      structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
--- 473,479 ----
      GRLayoutElement.__init__(self, parent)
      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,"<!--[/summ:%s]-->" % self.name)
***************
*** 514,522 ****
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRFirstRow')
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      if isfirst:
!       nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
      return nextSection
  
  
--- 491,499 ----
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRFirstRow')
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      if isfirst:
!       nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
      return nextSection
  
  
***************
*** 525,533 ****
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRNotFirstRow')
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      if not isfirst:
!       nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
      return nextSection
  
  
--- 502,510 ----
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRNotFirstRow')
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      if not isfirst:
!       nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
      return nextSection
  
  
***************
*** 535,544 ****
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRLastRow')
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
!     # TODO
!     if not nextSection:
!       nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
      return nextSection
  
  
--- 512,520 ----
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRLastRow')
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     if islast:
!       nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
      return nextSection
  
  
***************
*** 546,555 ****
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRNotLastRow')
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
!     # TODO
!     if nextSection:
!       nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
      return nextSection
  
  
--- 522,530 ----
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRNotLastRow')
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
!     if not islast:
!       nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
      return nextSection
  
  
***************
*** 563,578 ****
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRPassThru')
  
!   def process(self, dest, mapper, isfirst, firstSection, nextSection):
      dest.write('<%s' % self._xmltag)
      for attr in self._loadedxmlattrs.keys():
        dest.write(' %s="%s"' % (attr, 
saxutils.escape(str(self._loadedxmlattrs[attr]))))
  
      if len(self._children):
        dest.write('>')
!       nextSection = self.processChildren(dest, mapper, isfirst, firstSection, 
nextSection)
        dest.write('</%s>' % self._xmltag)
-       return nextSection
      else:
        dest.write('/>')
  
--- 538,553 ----
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRPassThru')
  
!   def process(self, dest, mapper, isfirst, islast, firstSection, nextSection):
      dest.write('<%s' % self._xmltag)
      for attr in self._loadedxmlattrs.keys():
        dest.write(' %s="%s"' % (attr, 
saxutils.escape(str(self._loadedxmlattrs[attr]))))
  
      if len(self._children):
        dest.write('>')
!       nextSection = self.processChildren(dest, mapper, isfirst, islast, 
firstSection, nextSection)
        dest.write('</%s>' % self._xmltag)
      else:
        dest.write('/>')
  
+     return nextSection



reply via email to

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