commit-gnue
[Top][All Lists]
Advanced

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

gnue gnue-common/src/GParser.py gnuef/setup.py ...


From: Jason Cater
Subject: gnue gnue-common/src/GParser.py gnuef/setup.py ...
Date: Sun, 07 Oct 2001 02:28:35 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/10/07 02:28:35

Modified files:
        gnue-common/src: GParser.py 
        gnuef          : setup.py 
        gnuef/src      : GFClient.py 
        reports        : AUTHORS INSTALL 
        reports/samples/mailmerge: mailmerge.py 
        reports/src    : GRDataMapper.py GRLayout.py GRReport.py 
                         GRSortOptions.py 
Added files:
        reports        : setup.cfg.in setup.py 
        reports/client : grrun.in 
        reports/src    : GRRun.py 
Removed files:
        reports/src    : grrun 

Log message:
        misc setup changes; misc fixes

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GParser.py.diff?cvsroot=OldCVS&tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/setup.py.diff?cvsroot=OldCVS&tr1=1.38&tr2=1.39&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFClient.py.diff?cvsroot=OldCVS&tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/setup.cfg.in?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/setup.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/AUTHORS.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/INSTALL.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/client/grrun.in?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/samples/mailmerge/mailmerge.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRRun.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRDataMapper.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRLayout.py.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRReport.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRSortOptions.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/GParser.py
diff -u gnue/gnue-common/src/GParser.py:1.20 
gnue/gnue-common/src/GParser.py:1.21
--- gnue/gnue-common/src/GParser.py:1.20        Thu Sep 13 18:39:21 2001
+++ gnue/gnue-common/src/GParser.py     Sun Oct  7 02:28:34 2001
@@ -57,28 +57,28 @@
 # returns that object.  If initialize is 1 (default), 
 # then the object is initialized and ready to go. 
 #
-# (initialize=0 is currently not used -- will probably 
-#  be used in the Forms/Reports Designer package where 
-#  we will not want the loaded form to connect to 
+# (initialize=0 is currently not used -- will probably
+#  be used in the Forms/Reports Designer package where
+#  we will not want the loaded form to connect to
 #  databases, etc)
 #
-# "attributes" is a dictionary containing extra 
-# attributes that should be attached to this object. 
+# "attributes" is a dictionary containing extra
+# attributes that should be attached to this object.
 #
-#  e.g., if attributes={myproperty:[0,1,2]}, then 
-#    before the object is initialized or returned, 
+#  e.g., if attributes={myproperty:[0,1,2]}, then
+#    before the object is initialized or returned,
 #    object.myproperty == [0,1,2].
 #
 #######################################################
 
-def loadXMLObject(URL, handler, rootType, xmlFileType, 
+def loadXMLObject(URL, handler, rootType, xmlFileType,
   initialize=1, attributes={}):
   # Create a parser
   parser = saxexts.make_parser()
-  
+
   # Create a stack for the parsing routine
   object = None
-    
+
   # Create the handler
   dh = handler()
 
@@ -89,23 +89,23 @@
 
   object = dh.getRoot()
 
-  if not object: 
+  if not object:
     print "Error loading %s: empty definition file" % (xmlFileType)
     sys.exit()
   elif object._type != rootType:
-    print "Error loading %s: not a valid %s definition (expected: %s, got: 
%s)" % (xmlFileType, 
+    print "Error loading %s: not a valid %s definition (expected: %s, got: 
%s)" % (xmlFileType,
          xmlFileType, rootType, object._type)
     sys.exit()
 
   #object.showTree()
 
-  for att in attributes.keys(): 
+  for att in attributes.keys():
     object.__dict__[att] = attributes[att]
 
   if initialize:
     GDebug.printMesg(10,"Initializing the object tree starting at %s" 
%(object))
 
-    # TODO: initializeTree is depreciated but left in here for 
+    # TODO: initializeTree is depreciated but left in here for
     # TODO: backwards compatibility.
     if hasattr(object,'initializeTree'):
       object.initializeTree()
@@ -157,10 +157,10 @@
   return string.join( string.split(text), ' ')
 
 
-def default(attrs, key, default): 
-  if attrs.has_key(key): 
+def default(attrs, key, default):
+  if attrs.has_key(key):
     return attrs[key]
-  else: 
+  else:
     return default
 
 
@@ -169,7 +169,7 @@
 # xmlHandler
 #
 # This class is called by the XML parser to
-# process the xml file.  
+# process the xml file.
 #
 #######################################################
 class xmlHandler(saxlib.HandlerBase):
@@ -182,16 +182,16 @@
     self.bootstrapflag = 0
     self.uniqueIDs = {}
     self.root = None
-    
-  def getRoot(self): 
+
+  def getRoot(self):
     return self.root
 
   def startElement(self, name, saxattrs):
-     
+
     GDebug.printMesg(50, "<%s>" % name)
-  
+
     # Make sure the tag we are looking at is a valid tag
-    if not self.xmlElements.has_key (name): 
+    if not self.xmlElements.has_key (name):
       print 'Error processing <%s> tag [I do not know what a <%s> tag does]' % 
(name, name)
       sys.exit()
 
@@ -202,33 +202,33 @@
     for attr in saxattrs.keys():
 
       # Make sure the attribute we are looking at is a valid attribute
-      if not baseAttrs.has_key(attr): 
+      if not baseAttrs.has_key(attr):
         print 'Error processing <%s> tag [I do not recognize the "%s" 
attribute' % (name, attr)
         sys.exit()
 
       # Typecasting, anyone?  If attribute should be int, make it an int
-      try: 
+      try:
         attrs[attr] = default(baseAttrs[attr],'Typecast',char)(saxattrs[attr])
         loadedxmlattrs[attr] = attrs[attr]
-      except: 
+      except:
         print 'Error processing <%s> tag [invalid type for "%s" attribute; 
value is "%s"]' % (name, attr, saxattrs[attr])
         sys.exit()
 
       # If this attribute must be unique, check for duplicates
-      if default (baseAttrs[attr],'Unique',0): 
-        if self.uniqueIDs.has_key('%s' % (saxattrs[attr])): 
+      if default (baseAttrs[attr],'Unique',0):
+        if self.uniqueIDs.has_key('%s' % (saxattrs[attr])):
           print 'Error processing <%s> tag ["%s" attribute should be unique; 
duplicate value is "%s"]' % (name, attr, saxattrs[attr])
           sys.exit()
+
+    for attr in baseAttrs.keys():
+      if not attrs.has_key(attr):
 
-    for attr in baseAttrs.keys(): 
-      if not attrs.has_key(attr): 
-    
         # Pull default values for missing attributes
-        if baseAttrs[attr].has_key ('Default'): 
+        if baseAttrs[attr].has_key ('Default'):
           attrs[attr] = default(baseAttrs[attr],'Typecast', char) 
(baseAttrs[attr]['Default'])
 
         # Check for missing required attributes
-        elif default(baseAttrs[attr], 'Required', 0): 
+        elif default(baseAttrs[attr], 'Required', 0):
           print 'Error processing <%s> tag [required attribute "%s" not 
present]' % (name, attr)
           sys.exit()
 
@@ -243,15 +243,15 @@
 
     object._xmltag = name
 
-    # Save the attributes loaded from XML file 
+    # Save the attributes loaded from XML file
     # (i.e., attributes that were not defaulted)
-    object._loadedxmlattrs = loadedxmlattrs  
+    object._loadedxmlattrs = loadedxmlattrs
 
-    for attr in attrs.keys(): 
+    for attr in attrs.keys():
       object.__dict__[attr] = attrs[attr]
 
     self.xmlStack.insert(0, object)
-    self.nameStack.insert(0, name) 
+    self.nameStack.insert(0, name)
 
 
   def characters(self, ch, start, length):
@@ -261,20 +261,20 @@
     if self.xmlStack[0] != None:
 
       # Should we keep the text?
-      if default(self.xmlElements[self.nameStack[0]],'MixedContent',0): 
+      if default(self.xmlElements[self.nameStack[0]],'MixedContent',0):
 
         if default(self.xmlElements[self.nameStack[0]],'KeepWhitespace',0):
           GContent(self.xmlStack[0], text)
-        else: 
+        else:
           # Normalize
           if len(string.replace(string.replace(string.replace(text,' 
',''),'\n',''),'\t','')):
             text = normalise_whitespace (text)
-          else: 
+          else:
             text = ""
-          if len(text): 
+          if len(text):
             GContent(self.xmlStack[0], text)
+
 
-    
   def endElement(self, name):
     self.nameStack.pop(0)
     child = self.xmlStack.pop(0)
@@ -287,26 +287,26 @@
 #
 # Class GContent
 #
-# Base class for xml content 
+# Base class for xml content
 #
-class GContent: 
+class GContent:
 
-  def __init__(self, parent, content): 
+  def __init__(self, parent, content):
     self._content = content
     if parent :
       parent.addChild(self)
 
-  def getEscapedContent(self): 
+  def getEscapedContent(self):
     return saxutils.escape(self._content)
 
-  def getContent(self): 
+  def getContent(self):
     return self._content
 
   def toXML(self): 
     return saxutils.escape(self._content)
 
   def dumpXML(self, lookupDict, treeDump=None, gap=None, escape=1):
-    if escape: 
+    if escape:
       return saxutils.escape(self._content)
     else: 
       return self._content
Index: gnue/gnuef/setup.py
diff -u gnue/gnuef/setup.py:1.38 gnue/gnuef/setup.py:1.39
--- gnue/gnuef/setup.py:1.38    Tue Sep 18 00:34:36 2001
+++ gnue/gnuef/setup.py Sun Oct  7 02:28:34 2001
@@ -49,7 +49,7 @@
 def developer_install():
   pwd = os.getcwd()
   gfcvs = """
-#!/bin/sh     
+#!/bin/sh
      if [ "z$GNUE_CONNECTIONS" = "z" ]
       then
        if [ -f /usr/local/gnue/etc/connections.conf ]
@@ -64,7 +64,7 @@
        export INSTALL_PREFIX
      fi
      PYTHONPATH=%s/.cvsdevelbase:$PYTHONPATH; export PYTHONPATH
-     %s %s/.cvsdevelbase/gnue/forms/GFClient.py $*
+     %s %s/.cvsdevelbase/gnue/reports/GRRun.py $*
   """ % (pwd, sys.executable, pwd)
 
   if os.path.isdir('.cvsdevelbase'):
@@ -77,7 +77,7 @@
     ln -s ../../src/__init__.py .
     ln -s ../../../gnue-common/src common
     ln -s ../../../reports/src reports
-    ln -s ../../src forms 
+    ln -s ../../src forms
     cd designer
     ln -s ../../../../designer/src/* .
     ln -s ../../../../designer/templates templates
@@ -88,7 +88,7 @@
   file.write(gfcvs)
   file.close
   os.system ('chmod 700 client/gfcvs')
-  
+
   if not os.path.islink('/usr/local/bin/gfcvs'):
     print "We will now create a symlink to client/gfcvs in /usr/local/bin"
     print "You will be prompted for the root password on the machine to do 
this."
Index: gnue/gnuef/src/GFClient.py
diff -u gnue/gnuef/src/GFClient.py:1.27 gnue/gnuef/src/GFClient.py:1.28
--- gnue/gnuef/src/GFClient.py:1.27     Mon Sep  3 13:29:14 2001
+++ gnue/gnuef/src/GFClient.py  Sun Oct  7 02:28:34 2001
@@ -1,5 +1,5 @@
 #
-# Copyright 2001 Free Software Foundation
+# Copyright 2000, 2001 Free Software Foundation
 #
 # This file is part of GNU Enterprise.
 #
@@ -30,12 +30,6 @@
 #    debug
 #    make the next/prec methods more generic in the GFForm
 #    change self._form in here to a list
-
-#
-# Copyright (c) 2000 Free Software Foundation
-#
-# $Id: GFClient.py,v 1.27 2001/09/03 17:29:14 jamest Exp $
-#
 
 import pstats
 import os
Index: gnue/reports/AUTHORS
diff -u gnue/reports/AUTHORS:1.2 gnue/reports/AUTHORS:1.3
--- gnue/reports/AUTHORS:1.2    Thu May 24 11:27:37 2001
+++ gnue/reports/AUTHORS        Sun Oct  7 02:28:34 2001
@@ -1,2 +1,2 @@
-Jason Cater <address@hidden>: 
-  Initial coding  
+Jason Cater <address@hidden>:
+  Initial coding
Index: gnue/reports/INSTALL
diff -u gnue/reports/INSTALL:1.2 gnue/reports/INSTALL:1.3
--- gnue/reports/INSTALL:1.2    Fri May 25 04:18:35 2001
+++ gnue/reports/INSTALL        Sun Oct  7 02:28:34 2001
@@ -1,4 +1,36 @@
-Currently, GNUe-Reports is not far enough along to justify an installation 
-script. (There is nothing to install :) 
+Installation instructions for GNUe-Reports
 
-See README for information on testing GNUe-Reports.
+Quick Ref: (read below for more info)
+=====================================
+
+./setup.py install
+
+Make sure that you've have a valid /usr/local/gnue/etc/gnue.conf
+This is installed by gnue-common package as a sample.gnue.conf
+you have to edit and move rename the file
+
+Currently, only a non-server report engine will run (i.e., the 
+background server implementation of Reports is not complete). 
+This means Reports is currently useful for evaluation or for 
+small, centralized (2-tier) sites. 
+
+
+General information:
+====================
+
+GNUe-Reports needs some prerequisites to work. You need a database
+managment system, python as programming language and a xml-handling
+library.  
+
+The following minimum programs are required for running GNUe-Reports: 
+
+ Python 2.0 or later           http://www.python.org/
+ PyXML                         http://pyxml.sourceforge.net/
+ GNUe-Common                   http://www.gnue.org/ 
+
+
+To do any useful report conversions, you may need any of the following: 
+ * A TeX formatting engine (e.g., for Linux, TeTeX) 
+ * An XSLT processor (see Sablotron at ????) 
+
+
Index: gnue/reports/samples/mailmerge/mailmerge.py
diff -u gnue/reports/samples/mailmerge/mailmerge.py:1.3 
gnue/reports/samples/mailmerge/mailmerge.py:1.4
--- gnue/reports/samples/mailmerge/mailmerge.py:1.3     Fri Oct  5 00:31:49 2001
+++ gnue/reports/samples/mailmerge/mailmerge.py Sun Oct  7 02:28:34 2001
@@ -137,4 +137,4 @@
 
 
 if __name__ == "__main__":
-  print "\nRun one of the merge-* samples.\n"
\ No newline at end of file
+  print "\nRun one of the merge-* samples.\n"
Index: gnue/reports/src/GRDataMapper.py
diff -u gnue/reports/src/GRDataMapper.py:1.4 
gnue/reports/src/GRDataMapper.py:1.5
--- gnue/reports/src/GRDataMapper.py:1.4        Sun Aug 12 15:55:27 2001
+++ gnue/reports/src/GRDataMapper.py    Sun Oct  7 02:28:35 2001
@@ -19,10 +19,10 @@
 # Copyright 2000, 2001 Free Software Foundation
 #
 # FILE:
-# GRLayout.py
+# GRDataMapper.py
 #
 # DESCRIPTION:
-# Class 
+# Helper class for use by GRLayout 
 #
 # NOTES:
 #
Index: gnue/reports/src/GRLayout.py
diff -u gnue/reports/src/GRLayout.py:1.7 gnue/reports/src/GRLayout.py:1.8
--- gnue/reports/src/GRLayout.py:1.7    Sun Aug 12 15:55:27 2001
+++ gnue/reports/src/GRLayout.py        Sun Oct  7 02:28:35 2001
@@ -11,7 +11,7 @@
 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 # PURPOSE. See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public 
+# 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.
@@ -22,7 +22,7 @@
 # GRLayout.py
 #
 # DESCRIPTION:
-# Class 
+# Class
 #
 # NOTES:
 #
@@ -321,37 +321,37 @@
 
 ############################################################
 #
-# <param> tag 
+# <param> tag
 #
-# Note that this can be present in conditions or in 
-# layout.  Since layout requires extra care, the 
+# Note that this can be present in conditions or in
+# layout.  Since layout requires extra care, the
 # class is actually defined here instead of GRSources.
 #
-class GRParam(GRLayoutElement, GConditions.GCParam): 
-  def __init__(self, parent): 
-    GRLayoutElement.__init__(self, parent, 'GRParam') 
-    self.name = "" 
+class GRParam(GRLayoutElement, GConditions.GCParam):
+  def __init__(self, parent):
+    GRLayoutElement.__init__(self, parent, 'GRParam')
+    self.name = ""
     self._value = ""
 
-  def proces(self, dest, mapper): 
+  def process(self, dest, mapper):
     structuralComment(dest,"<!--[param:%s]-->" % self.name)
-    if self._value != None: 
+    if self._value != None:
       dest.write ("%s" % self._value)
     structuralComment(dest,"<!--[/param:%s]-->" % self.name)
-  
+
 
 ############################################################
 #
 # <summ> tag
 #
-class GRSumm (GRLayoutElement): 
+class GRSumm (GRLayoutElement):
   def __init__(self, parent):
     GRLayoutElement.__init__(self, parent, 'GRSumm')
     self.section = None
     self.function = "count"
     self.format = None
 
-  def process(self, dest, mapper): 
+  def process(self, dest, mapper):
     structuralComment(dest,"<!--[summ:%s]-->" % self.name)
     dest.write (self._mymapper.getSummary(self.name, self.function, 
self.format))
     structuralComment(dest,"<!--[/summ:%s]-->" % self.name)
Index: gnue/reports/src/GRReport.py
diff -u gnue/reports/src/GRReport.py:1.9 gnue/reports/src/GRReport.py:1.10
--- gnue/reports/src/GRReport.py:1.9    Wed Jun  6 01:25:00 2001
+++ gnue/reports/src/GRReport.py        Sun Oct  7 02:28:35 2001
@@ -16,7 +16,7 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place 
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000 Free Software Foundation
+# Copyright 2000, 2001 Free Software Foundation
 #
 # FILE:
 # GRReport.py
Index: gnue/reports/src/GRSortOptions.py
diff -u gnue/reports/src/GRSortOptions.py:1.2 
gnue/reports/src/GRSortOptions.py:1.3
--- gnue/reports/src/GRSortOptions.py:1.2       Wed May 23 18:54:42 2001
+++ gnue/reports/src/GRSortOptions.py   Sun Oct  7 02:28:35 2001
@@ -16,7 +16,7 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place 
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000 Free Software Foundation
+# Copyright 2000, 2001 Free Software Foundation
 #
 # FILE:
 # GRSortOptions.py



reply via email to

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