commit-gnue
[Top][All Lists]
Advanced

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

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


From: Jason Cater
Subject: gnue/reports/src GRDataMapper.py GRReport.py GR...
Date: Thu, 25 Oct 2001 01:00:18 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/10/25 01:00:18

Modified files:
        reports/src    : GRDataMapper.py GRReport.py GRServer.py 
Added files:
        reports/src    : GRServices.py 

Log message:
        synching machines

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRServices.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRDataMapper.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRReport.py.diff?cvsroot=OldCVS&tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRServer.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/reports/src/GRDataMapper.py
diff -u gnue/reports/src/GRDataMapper.py:1.6 
gnue/reports/src/GRDataMapper.py:1.7
--- gnue/reports/src/GRDataMapper.py:1.6        Mon Oct 15 00:15:51 2001
+++ gnue/reports/src/GRDataMapper.py    Thu Oct 25 01:00:18 2001
@@ -75,14 +75,14 @@
   #
   #  Add a field
   #
-  def addField(self, name): 
+  def addField(self, name):
     self.fields[name] = ""
 
 
   #
   #  Add a summary
   #
-  def addSummary(self, name, function): 
+  def addSummary(self, name, function):
     if not self.summaries.has_key(name): 
       self.summaries[name] = {function:0}
     else: 
@@ -133,7 +133,7 @@
 
   #  Used in GRSources.__connectMasterDetail to link detail datasource to 
   #  master source.  Called by GDataObjects.ResultSet when master changed
-  #  This will actually be over-written by GRDataMapper but at the time 
+  #  This will actually be over-written by GRDataMapper but at the time
   #  the master-detail must be linked, the GRDataMapper will not have been 
   #  created yet.  [Yes, it's fugly]
   def _masterChanged(self, masterResultSet, detailResultSet): 
@@ -142,31 +142,31 @@
 
 
 ###########################################
-#  
 #
+#
 ###########################################
 class GRDataMapper(GRDataMapperSection):
 
-  def __init__(self, sources): 
+  def __init__(self, sources):
     GRDataMapperSection.__init__(self, "", "", None)
     self.sources = sources
     self.sectionMap = {}
     self.sourceMap = {}
 
-  def addSection(self, section, source, parentSection): 
-    if source == None: 
-      return 
-    if self.sectionMap.has_key (section): 
+  def addSection(self, section, source, parentSection):
+    if source == None:
+      return
+    if self.sectionMap.has_key (section):
       raise GRExceptions.SectionHasDuplicateName, \
-         "Section %s is defined multiple times" % section
+         'Section "%s" is defined multiple times' % section
 
     if parentSection == None or not self.sectionMap.has_key(parentSection):
       parentMapper = self
     else:
-      parentMapper = self.sectionMap[parentSection] 
+      parentMapper = self.sectionMap[parentSection]
 
     if self.sourceMap.has_key(source) and \
-       not self.sourceMap[source][0].isAncestorOf(parentMapper): 
+       not self.sourceMap[source][0].isAncestorOf(parentMapper):
       raise GRExceptions.SourceMappedToSiblingSections, \
          "Section %s attempts to use source %s but does not descend from %s" \
                (section, source, self.sourceMap[source][0].name)
@@ -175,77 +175,77 @@
 
     self.sectionMap[section] = mapper
 
-    if not self.sourceMap.has_key(source): 
+    if not self.sourceMap.has_key(source):
       GDebug.printMesg(5,"Setting section %s as source controller" % self.name)
       self.sourceMap[source] = [mapper]
       mapper.toplevel = 1
       mapper.datasource = self.sources.getDataSource(source)
       mapper.datasource.masterResultSetChanged = mapper._masterChanged
-    else: 
+    else:
       self.sourceMap[source][-1].grouping = 1
       self.sourceMap[source].append(mapper)
 
     GDebug.printMesg (10, "sourceMap=%s" % self.sourceMap)
 
-  def addFieldToSection(self, section, field): 
+  def addFieldToSection(self, section, field):
     self.sectionMap[section].addField(field)
     self.sources.getDataSource(self.sectionMap[section].source) \
           .referenceField(field)
-    
-  def addSummaryToSection(self, section, field, function): 
+
+  def addSummaryToSection(self, section, field, function):
     pass  # This should probably be replaced with real code :)
 
 
-  # 
+  #
   #
   #
-  def getFirstRecord(self, source): 
+  def getFirstRecord(self, source):
 
-    if source == None: 
+    if source == None:
       GDebug.printMesg (4, 'Skipping ResultSet creation for empty source')
       return None
 
-    for s in self.sourceMap[source]: 
+    for s in self.sourceMap[source]:
       s.resetState()
 
     controlSection = self.sourceMap[source][0]
 
     # Only load a new resultset if this is not a child source
     # as child sources were queries by the master
-    if controlSection.parent == None or controlSection.parent.source == "": 
+    if controlSection.parent == None or controlSection.parent.source == "":
       GDebug.printMesg (4, 'Creating ResultSet for source %s' % source)
       controlSection.resultset = self.sources.getDataSource(source)\
              .getDataObject().createResultSet(readOnly=1)
-    else: 
+    else:
       GDebug.printMesg(4, 'Getting pre-created ResultSet for source "%s"; 
parent=%s' \
              % (source, controlSection.parent))
 
     return self.getNextRecord(source)
 
 
-  # Returns a string containing first section to change. 
+  # Returns a string containing first section to change.
   # If None, then this datasource is all used up.
-  def getNextRecord(self, source): 
+  def getNextRecord(self, source):
 
     GDebug.printMesg (6, 'Getting next record for source %s' % source)
-    if source == None: 
+    if source == None:
       GDebug.printMesg (6, 'No next record to return for source %s' % source)
       return None
 
     controlSection = self.sourceMap[source][0]
 
-    if not controlSection.resultset.nextRecord(): 
+    if not controlSection.resultset.nextRecord():
       return None
-    else: 
+    else:
       recordset = controlSection.resultset.current
       firstSection = None
-      for s in self.sourceMap[source]: 
+      for s in self.sourceMap[source]:
         s._loadFields(recordset)
-        if firstSection == None and s.changed: 
+        if firstSection == None and s.changed:
           GDebug.printMesg(10, "After next record, first changed section is 
%s" % s.name)
           firstSection = s.name
       return firstSection
-        
-     
+
+
 
 
Index: gnue/reports/src/GRReport.py
diff -u gnue/reports/src/GRReport.py:1.15 gnue/reports/src/GRReport.py:1.16
--- gnue/reports/src/GRReport.py:1.15   Mon Oct 22 19:01:34 2001
+++ gnue/reports/src/GRReport.py        Thu Oct 25 01:00:18 2001
@@ -54,7 +54,7 @@
   # TODO: This is duplicating functionality in GRSources.prepare!!
   def __buildDataSources(self, object):
     if object.getObjectType() == "GRDataSource":
-      GDebug.printMesg(3,"Attaching DataSource %s to %s" \
+      GDebug.printMesg(3,"Attaching DataSource '%s' to '%s'" \
                          % (object.name, self._connections) )
       object.setConnectionManager(self._connections)
       self._datasourceDictionary[object.name] = object
@@ -119,7 +119,7 @@
     layout.process(dest, includeStructuralComments)
 
     if not omitGNUeXML: 
-      dest.write ("</GNUe-report-output>\n")
+      dest.write ("\n</GNUe-report-output>\n")
 
 
   def getChildOfType(self, type):
Index: gnue/reports/src/GRServer.py
diff -u gnue/reports/src/GRServer.py:1.2 gnue/reports/src/GRServer.py:1.3
--- gnue/reports/src/GRServer.py:1.2    Wed Oct 24 14:37:59 2001
+++ gnue/reports/src/GRServer.py        Thu Oct 25 01:00:18 2001
@@ -1,9 +1,9 @@
 #
 # This file is part of GNU Enterprise.
 #
-# GNU Enterprise is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General Public 
-# License as published by the Free Software Foundation; either 
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
 # version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
@@ -17,6 +17,14 @@
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
 # Copyright 2001 Free Software Foundation
+#
+# FILE:
+# GRServer.py
+#
+# DESCRIPTION:
+# Class that defines the Server component of GNUe Reports.
+#
+# NOTES:
 #
 
 



reply via email to

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