commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnue-common/gnue/common GObjects.py GParse...


From: Jason Cater
Subject: gnue/gnue-common/gnue/common GObjects.py GParse...
Date: Sat, 26 May 2001 15:26:08 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/05/26 15:26:07

Modified files:
        gnue-common/gnue/common: GObjects.py GParser.py 

Log message:
        Fixed GParser problem with removing newlines from content. Also, minor 
changes for reports.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GObjects.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GParser.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gnue/gnue-common/gnue/common/GObjects.py
diff -u gnue/gnue-common/gnue/common/GObjects.py:1.5 
gnue/gnue-common/gnue/common/GObjects.py:1.6
--- gnue/gnue-common/gnue/common/GObjects.py:1.5        Thu May 17 11:59:32 2001
+++ gnue/gnue-common/gnue/common/GObjects.py    Sat May 26 15:26:07 2001
@@ -80,11 +80,11 @@
   def buildObject(self): 
     pass
 
-  def getChildrenAsContent(self, joinString=""): 
+  def getChildrenAsContent(self): 
     content = "" 
     for child in self._children: 
       if isinstance(child, GContent): 
-        content = content + child._content + joinString
+        content = content + child._content
     return content
 
   def showTree(self, indent=0): 
Index: gnue/gnue-common/gnue/common/GParser.py
diff -u gnue/gnue-common/gnue/common/GParser.py:1.6 
gnue/gnue-common/gnue/common/GParser.py:1.7
--- gnue/gnue-common/gnue/common/GParser.py:1.6 Fri May 11 18:42:55 2001
+++ gnue/gnue-common/gnue/common/GParser.py     Sat May 26 15:26:07 2001
@@ -223,13 +223,15 @@
   def characters(self, ch, start, length):
 
     text = ch[start:start+length]
-    # print "####" + text + "####"
+    #print "####" + text + "####"
     if self.xmlStack[0] != None:
-      if len(string.replace(string.replace(string.replace(text,' 
',''),'\n',''),'\t','')):
         # Should we normalize the text: 
         if self.xmlElements[self.nameStack[0]][2]: 
           #print "Normalizing..."
-          text = normalise_whitespace (text)
+          if len(string.replace(string.replace(string.replace(text,' 
',''),'\n',''),'\t','')):
+            text = normalise_whitespace (text)
+          else: 
+            text = ""
           if len(text): 
             GContent(self.xmlStack[0], text)
         else: 
@@ -241,7 +243,7 @@
     self.nameStack.pop(0)
     child = self.xmlStack.pop(0)
     child.buildObject()
-    #print "</%s>" % name
+    print "</%s>" % name
 
 
 
@@ -258,6 +260,12 @@
     if parent :
       parent.addChild(self)
 
+  def getEscapedContent(self): 
+    return saxutils.escape(self._content)
+
+  def getContent(self): 
+    return saxutils.escape(self._content)
+
   def toXML(self): 
     return saxutils.escape(self._content)
 
@@ -266,4 +274,7 @@
 
   def showTree(self, indent=0): 
     print ' '*indent + 'GContent ' + `self._content`
+
+  def getObjectType(self): 
+    return "_content_"
 



reply via email to

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