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 01:51:29 -0400

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

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

Log message:
        fixed layout-level param output; improved support for firstRow and 
notFirstRow

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/samples/foobulations/monthly.grd.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRDataMapper.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRLayout.py.diff?cvsroot=OldCVS&tr1=1.19&tr2=1.20&r1=text&r2=text

Patches:
Index: gnue/reports/samples/foobulations/monthly.grd
diff -c gnue/reports/samples/foobulations/monthly.grd:1.4 
gnue/reports/samples/foobulations/monthly.grd:1.5
*** gnue/reports/samples/foobulations/monthly.grd:1.4   Sat Apr  6 02:27:26 2002
--- gnue/reports/samples/foobulations/monthly.grd       Mon Apr  8 01:51:28 2002
***************
*** 19,25 ****
      <out:reportTitle>Monthly Accounting Foobulation Report</out:reportTitle>
  
      <out:section break="page">
!       <out:sectionTitle><param name="subtitle"/></out:sectionTitle>
        <out:table width="100%">
          <out:tablehead>
            <out:colhead width="40">Name</out:colhead>
--- 19,25 ----
      <out:reportTitle>Monthly Accounting Foobulation Report</out:reportTitle>
  
      <out:section break="page">
!       <out:sectionTitle><!--param name="subtitle"/--></out:sectionTitle>
        <out:table width="100%">
          <out:tablehead>
            <out:colhead width="40">Name</out:colhead>
Index: gnue/reports/src/GRDataMapper.py
diff -c gnue/reports/src/GRDataMapper.py:1.9 
gnue/reports/src/GRDataMapper.py:1.10
*** gnue/reports/src/GRDataMapper.py:1.9        Thu Apr  4 18:38:20 2002
--- gnue/reports/src/GRDataMapper.py    Mon Apr  8 01:51:29 2002
***************
*** 165,174 ****
      else:
        parentMapper = self.sectionMap[parentSection]
  
-     print "parentSection=%s" % parentSection
-     print "parentMapper=%s" % parentMapper
-     print "sourceMap=%s" % self.sourceMap
- 
      if self.sourceMap.has_key(source) and \
         not self.sourceMap[source][0].isAncestorOf(parentMapper):
        raise GRExceptions.SourceMappedToSiblingSections, \
--- 165,170 ----
Index: gnue/reports/src/GRLayout.py
diff -c gnue/reports/src/GRLayout.py:1.19 gnue/reports/src/GRLayout.py:1.20
*** gnue/reports/src/GRLayout.py:1.19   Sat Apr  6 21:13:31 2002
--- gnue/reports/src/GRLayout.py        Mon Apr  8 01:51:29 2002
***************
*** 104,115 ****
  
        if isinstance(object, GRSection) and object._source != None:
          if parentSection is None:
!           self._mapper.addSection(object.name, object._source, None)
          else:
!           self._mapper.addSection(object.name,
                                    object._source,
!                                   parentSection.name)
!         object._mymapper = self._mapper.sectionMap[object.name]
          object._mymapper._object = object
  
        elif isinstance(object, GRField):
--- 104,115 ----
  
        if isinstance(object, GRSection) and object._source != None:
          if parentSection is None:
!           self._mapper.addSection(object._name, object._source, None)
          else:
!           self._mapper.addSection(object._name,
                                    object._source,
!                                   parentSection._name)
!         object._mymapper = self._mapper.sectionMap[object._name]
          object._mymapper._object = object
  
        elif isinstance(object, GRField):
***************
*** 117,131 ****
          if s == None:
            raise SourceOutOfScope, \
                  'Field "%s" in section "%s" uses out-of-scope source "%s"' \
!                      % (object.name, parentSection.name, object._source)
  
!         object._section = s.name
  
          if hasattr(object,'section') and object.section:
            curr = s
            section = None
            while curr:
!             if curr.name == object.section:
                section = curr
                break
              curr = s._parent.findParentOfType('GRSection')
--- 117,132 ----
          if s == None:
            raise SourceOutOfScope, \
                  'Field "%s" in section "%s" uses out-of-scope source "%s"' \
!                      % (object.name, parentSection._name, object._source)
  
!         object._section = s._name
  
          if hasattr(object,'section') and object.section:
+           sec = string.lower(object.section)
            curr = s
            section = None
            while curr:
!             if curr._name == sec:
                section = curr
                break
              curr = s._parent.findParentOfType('GRSection')
***************
*** 133,141 ****
            if section == None:
              raise SourceOutOfScope, \
                  'Field "%s" in section "%s" uses out-of-scope section "%s"' \
!                      % (object.name, parentSection.name, object.section)
  
!           object._section = section.name
  
          object._mymapper = self._mapper.sectionMap[object._section]
  
--- 134,142 ----
            if section == None:
              raise SourceOutOfScope, \
                  'Field "%s" in section "%s" uses out-of-scope section "%s"' \
!                      % (object.name, parentSection._name, object.section)
  
!           object._section = section._name
  
          object._mymapper = self._mapper.sectionMap[object._section]
  
***************
*** 158,164 ****
                'Summary "%s" in section "%s" uses out-of-scope source "%s"' \
                     % (object.name, object._parent.name, object._source)
  
!         object._section = s.name
          object._mymapper = self._mapper.sectionMap[object._section]
  
          GDebug.printMesg(6,'Mapping summary %s [%s] to section %s' \
--- 159,165 ----
                'Summary "%s" in section "%s" uses out-of-scope source "%s"' \
                     % (object.name, object._parent.name, object._source)
  
!         object._section = s._name
          object._mymapper = self._mapper.sectionMap[object._section]
  
          GDebug.printMesg(6,'Mapping summary %s [%s] to section %s' \
***************
*** 237,243 ****
            GDebug.printMesg(10, "Calling new controlling section")
            child.processAsController(dest, mapper)
          else:
!           child.process(dest, mapper, isfirst)
  
    #
    #  getAncestorWithSource()
--- 238,244 ----
            GDebug.printMesg(10, "Calling new controlling section")
            child.processAsController(dest, mapper)
          else:
!           child.process(dest, mapper, isfirst or isinstance(child, GRSection))
  
    #
    #  getAncestorWithSource()
***************
*** 258,270 ****
  
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRSection')
  
    def _buildObject(self):
      if not hasattr(self,'name') or self.name == None:
!       self.name = id(self)
      else:
        self._name = string.lower(self.name)
  
      return ContainerElement._buildObject(self)
  
  
--- 259,278 ----
  
    def __init__(self, parent):
      ContainerElement.__init__(self, parent, 'GRSection')
+     self._childSections = []
  
    def _buildObject(self):
      if not hasattr(self,'name') or self.name == None:
!       self._name = id(self)
      else:
        self._name = string.lower(self.name)
  
+     # Keep track of "child" section names (for the firstRow stuff)
+     psec = self._parent.findParentOfType('GRSection')
+     if psec is not None:
+       psec._childSections = self._childSections[:]
+       psec._childSections.insert(0, self._name)
+ 
      return ContainerElement._buildObject(self)
  
  
***************
*** 278,284 ****
    def processAsController(self, dest, mapper):
  
      GDebug.printMesg(10,
!        "Controlling section %s's processAsController() called" % self.name)
  
      if self._source == None:
        # This is a dataless section...
--- 286,292 ----
    def processAsController(self, dest, mapper):
  
      GDebug.printMesg(10,
!        "Controlling section %s's processAsController() called" % self._name)
  
      if self._source == None:
        # This is a dataless section...
***************
*** 296,310 ****
        while section:
  
  
-         try:
-           print "OldSection = %s" % oldSection.name
-         except:
-           print "OldSection = None"
-           
-         print "Section = %s" % section.name
- 
          # Process the current data row starting at correct section
!         section.process(dest, mapper, isfirst=(oldSection != section))
  
          # Determine the next section to process our data.
          # (i.e., handle section grouping)
--- 304,312 ----
        while section:
  
  
          # Process the current data row starting at correct section
!         section.process(dest, mapper,
!              isfirst=(oldSection in section._childSections))
  
          # Determine the next section to process our data.
          # (i.e., handle section grouping)
***************
*** 314,320 ****
          if goto == None:
            section = None
          else:
!           oldSection = section
            section = mapper.sectionMap[goto]._object
  
      else:
--- 316,322 ----
          if goto == None:
            section = None
          else:
!           oldSection = section._name
            section = mapper.sectionMap[goto]._object
  
      else:
***************
*** 342,352 ****
    # current record and handle any children.
    def process(self, dest, mapper, isfirst=0):
  
!     GDebug.printMesg(10,"Repeating Section %s" % self.name)
!     structuralComment(dest,"<!--[section:%s]-->" % self.name)
      self.processChildren(dest, mapper, isfirst)
!     structuralComment(dest,"<!--[/section:%s]-->" % self.name)
!     GDebug.printMesg(10,"Leaving section %s" % self.name)
  
  
  ############################################################
--- 344,354 ----
    # current record and handle any children.
    def process(self, dest, mapper, isfirst=0):
  
!     GDebug.printMesg(10,"Repeating Section %s" % self._name)
!     structuralComment(dest,"<!--[section:%s]-->" % self._name)
      self.processChildren(dest, mapper, isfirst)
!     structuralComment(dest,"<!--[/section:%s]-->" % self._name)
!     GDebug.printMesg(10,"Leaving section %s" % self._name)
  
  
  ############################################################
***************
*** 439,444 ****
--- 441,452 ----
    def __init__(self, parent):
      GRLayoutElement.__init__(self, parent)
      GRStubParam.__init__(self, parent)
+ 
+   def process(self, dest, mapper, isfirst=0):
+     structuralComment(dest,"<!--[param:%s]-->" % self.name)
+     dest.write (self.getFormattedValue())
+     structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
+ 
  
  
  



reply via email to

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