[Zodb-checkins] CVS: StandaloneZConfig/ZConfig - cfgparser.py:1.11
datatypes.py:1.27 info.py:1.22 loader.py:1.33 schema.py:1.34
substitution.py:1.5
Fred L. Drake, Jr.
fred at zope.com
Mon Apr 12 11:27:32 EDT 2004
Update of /cvs-repository/StandaloneZConfig/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv30650
Modified Files:
cfgparser.py datatypes.py info.py loader.py schema.py
substitution.py
Log Message:
remove incomplete support for Python 2.1 and 2.2; we simply require 2.3 now
=== StandaloneZConfig/ZConfig/cfgparser.py 1.10 => 1.11 ===
--- StandaloneZConfig/ZConfig/cfgparser.py:1.10 Tue Oct 7 13:53:43 2003
+++ StandaloneZConfig/ZConfig/cfgparser.py Mon Apr 12 11:27:00 2004
@@ -18,12 +18,6 @@
from ZConfig.substitution import isname, substitute
-try:
- True
-except NameError:
- True = 1
- False = 0
-
class ZConfigParser:
__metaclass__ = type
=== StandaloneZConfig/ZConfig/datatypes.py 1.26 => 1.27 ===
--- StandaloneZConfig/ZConfig/datatypes.py:1.26 Fri Mar 19 11:08:00 2004
+++ StandaloneZConfig/ZConfig/datatypes.py Mon Apr 12 11:27:00 2004
@@ -21,18 +21,9 @@
try:
unicode
except NameError:
- UnicodeType = None
- StringTypes = type(''),
+ have_unicode = False
else:
- UnicodeType = type(unicode(''))
- StringTypes = type(''), UnicodeType
-
-# True, False were added in Python 2.2.1
-try:
- True
-except NameError:
- True = 1
- False = 0
+ have_unicode = True
class MemoizedConversion:
@@ -113,7 +104,7 @@
class ASCIIConversion(RegularExpressionConversion):
def __call__(self, value):
value = RegularExpressionConversion.__call__(self, value)
- if UnicodeType is not None and isinstance(value, UnicodeType):
+ if have_unicode and isinstance(value, unicode):
value = value.encode("ascii")
return value
@@ -214,7 +205,7 @@
self.address = inet_address(s)
def float_conversion(v):
- if type(v) in StringTypes:
+ if isinstance(v, basestring):
if v.lower() in ["inf", "-inf", "nan"]:
raise ValueError(`v` + " is not a portable float representation")
return float(v)
=== StandaloneZConfig/ZConfig/info.py 1.21 => 1.22 ===
--- StandaloneZConfig/ZConfig/info.py:1.21 Tue Mar 16 15:47:24 2004
+++ StandaloneZConfig/ZConfig/info.py Mon Apr 12 11:27:00 2004
@@ -18,13 +18,6 @@
import ZConfig
-try:
- True
-except NameError:
- True = 1
- False = 0
-
-
class UnboundedThing:
__metaclass__ = type
__slots__ = ()
=== StandaloneZConfig/ZConfig/loader.py 1.32 => 1.33 ===
--- StandaloneZConfig/ZConfig/loader.py:1.32 Wed Feb 11 16:31:46 2004
+++ StandaloneZConfig/ZConfig/loader.py Mon Apr 12 11:27:00 2004
@@ -26,12 +26,6 @@
import ZConfig.schema
import ZConfig.url
-try:
- True
-except NameError:
- True = 1
- False = 0
-
def loadSchema(url):
return SchemaLoader().loadURL(url)
=== StandaloneZConfig/ZConfig/schema.py 1.33 => 1.34 ===
--- StandaloneZConfig/ZConfig/schema.py:1.33 Tue Mar 16 17:02:08 2004
+++ StandaloneZConfig/ZConfig/schema.py Mon Apr 12 11:27:00 2004
@@ -22,22 +22,6 @@
from ZConfig import url
-try:
- True
-except NameError:
- True = 1
- False = 0
-
-try:
- dict
-except NameError:
- def dict(mapping):
- d = {}
- for k, v in mapping.items():
- d[k] = v
- return d
-
-
def parseResource(resource, loader):
parser = SchemaParser(loader, resource.url)
xml.sax.parse(resource.file, parser)
=== StandaloneZConfig/ZConfig/substitution.py 1.4 => 1.5 ===
--- StandaloneZConfig/ZConfig/substitution.py:1.4 Sat Aug 2 01:03:57 2003
+++ StandaloneZConfig/ZConfig/substitution.py Mon Apr 12 11:27:00 2004
@@ -15,12 +15,6 @@
import ZConfig
-try:
- True
-except NameError:
- True = 1
- False = 0
-
def substitute(s, mapping):
"""Interpolate variables from `mapping` into `s`."""
More information about the Zodb-checkins
mailing list