[Zope3-checkins] CVS: Zope/lib/python/ZConfig - SchemaParser.py:1.1.2.20

Fred L. Drake, Jr. fred@zope.com
Fri, 6 Dec 2002 12:40:49 -0500


Update of /cvs-repository/Zope/lib/python/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv28769

Modified Files:
      Tag: chrism-install-branch
	SchemaParser.py 
Log Message:
Minor nits.


=== Zope/lib/python/ZConfig/SchemaParser.py 1.1.2.19 => 1.1.2.20 ===
--- Zope/lib/python/ZConfig/SchemaParser.py:1.1.2.19	Fri Dec  6 11:06:23 2002
+++ Zope/lib/python/ZConfig/SchemaParser.py	Fri Dec  6 12:40:47 2002
@@ -85,23 +85,22 @@
                 self.doSchemaError(`name` + " element outside of schema")
             self.handleCdata(name)
         else:
-            self.doSchemaError("Unknown tag %s" % name)
+            self.doSchemaError("Unknown tag " + name)
 
     def characters(self, data):
         data = data.strip()
-        if not data:
-            return
-        attr = self.getCurrentCdata()
-        if attr is None:
-            self.doSchemaError('#pcdata only valid within %s tags'
-                               % `self._cdata_tags`[1:-1])
-        setattr(self._stack[-1], attr, data)
+        if data:
+            attr = self.getCurrentCdata()
+            if attr is None:
+                self.doSchemaError('#pcdata only valid within %s tags'
+                                   % `self._cdata_tags`[1:-1])
+            setattr(self._stack[-1], attr, data)
 
     def endElement(self, name):
         if name in self._cdata_tags:
             self._current_cdata_attr = None
-            return
-        self._stack.pop()
+        else:
+            self._stack.pop()
 
     def endDocument(self):
         if not self._schema:
@@ -119,14 +118,14 @@
             if v is ConfigMissing:
                 l.append(k)
         if l:
-            self.doSchemaError('Class loading failed for: %s' % ', '.join(l))
+            self.doSchemaError('Class loading failed for ' + ', '.join(l))
 
     def getCurrentCdata(self):
         return self._current_cdata_attr
 
     def handleCdata(self, name):
         if not self._stack:
-            msg = '%s only valid within a schema, section, or key' % name
+            msg = name + ' only valid within a schema, section, or key'
             self.doSchemaError(msg)
         current = self.getCurrentCdata()
         if current:
@@ -159,7 +158,7 @@
             l.append(attr)
         if attrs:
             self.doSchemaError(
-                'Unknown attribute(s): %s' % ', '.join(attrs.keys())
+                'Unknown attribute(s): ' + ', '.join(attrs.keys())
                 )
         return l
 
@@ -279,7 +278,7 @@
 
     def __str__(self):
         if self.line is not None:
-            pos = " at line %d, column %s" % (self.line, self.col)
+            pos = " at line %d, column %d" % (self.line, self.col)
         else:
             pos = " (unknown position)"
         return self.message + pos