[Zope-Checkins] CVS: Zope3/lib/python/Zope/DocumentTemplate - DT_String.py:1.2 pDocumentTemplate.py:1.2

Stephan Richter srichter@cbu.edu
Wed, 10 Jul 2002 20:54:32 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/DocumentTemplate
In directory cvs.zope.org:/tmp/cvs-serv23423/Zope/DocumentTemplate

Modified Files:
	DT_String.py pDocumentTemplate.py 
Log Message:
 Adjustments to DTML and other code


=== Zope3/lib/python/Zope/DocumentTemplate/DT_String.py 1.1 => 1.2 ===
 
 
     def default(self, name=None, **kw):
-        """\
-        Change or query default values in a document template.
+        """Change or query default values in a document template.
 
         If a name is specified, the value of the named default value
         before the operation is returned.


=== Zope3/lib/python/Zope/DocumentTemplate/pDocumentTemplate.py 1.1 => 1.2 ===
 """
 
 import sys
-from types import StringType, TupleType, ClassType
+from types import StringTypes, TupleType, ClassType
 ClassTypes = [ClassType]
 
 
@@ -182,7 +182,7 @@
             if l == 1:
                 # Simple var
                 section = section[0]
-                if type(section) is StringType:
+                if isinstance(section, StringTypes):
                     section = md[section]
                 else:
                     section = section(md)
@@ -196,7 +196,7 @@
                     m = l-1
                     while i < m:
                         cond = section[i]
-                        if type(cond) is StringType:
+                        if isinstance(cond, StringTypes):
                             n = cond
                             try:
                                 cond = md[cond]
@@ -224,7 +224,7 @@
 
                 finally: md._pop()
 
-        elif type(section) is not StringType:
+        elif not isinstance(section, StringTypes):
             section = section(md)
 
         if section: