[Zope-Checkins] CVS: Zope/lib/python/ZConfig - SchemaParser.py:1.1.2.13

Fred L. Drake, Jr. fred@zope.com
Tue, 26 Nov 2002 13:24:39 -0500


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

Modified Files:
      Tag: chrism-install-branch
	SchemaParser.py 
Log Message:
Minor whitespace changes.
Use True/False instead of 1/0 for booleans.
If we're using a pyexpat that implements buffer_text, set it.


=== Zope/lib/python/ZConfig/SchemaParser.py 1.1.2.12 => 1.1.2.13 ===
--- Zope/lib/python/ZConfig/SchemaParser.py:1.1.2.12	Tue Nov 26 12:38:54 2002
+++ Zope/lib/python/ZConfig/SchemaParser.py	Tue Nov 26 13:24:38 2002
@@ -11,7 +11,6 @@
 #
 ##############################################################################
 """
-
 Schema Parser module -- parses schema XML into a Python data structure
 for use with ZConfig.
 
@@ -71,10 +70,12 @@
         from xml.parsers import expat
         XMLParseError = expat.ExpatError
         parser = expat.ParserCreate(encoding, ' ')
-        parser.returns_unicode = 0
+        parser.returns_unicode = False
+        if hasattr(parser, 'buffer_text'):
+            parser.buffer_text = True
         return parser
 
-    def __call__(self, f, context, print_classes=0):
+    def __call__(self, f, context, print_classes=False):
         self._stack = []
         self._seen_classes = {}
         self._prefix = ''
@@ -317,8 +318,8 @@
         try:
             self.default()
         except ConfigurationError:
-            return 0
-        return 1
+            return False
+        return True
 
     # subclass required methods
     def default(self):
@@ -435,10 +436,8 @@
             return self.data[(meta_type, type, name)]
         except KeyError:
             raise ConfigurationError(
-                'invalid %s of type "%s" with name "%s"' % (
-                meta_type, type, name
-                )
-                )
+                'invalid %s of type "%s" with name "%s"'
+                % (meta_type, type, name))
 
     def getAllSubs(self):
         return list(self.subs)