[Zope-Checkins] CVS: Packages/ZConfig - datatypes.py:1.1.2.16
Fred L. Drake, Jr.
fred@zope.com
Fri, 20 Dec 2002 14:55:00 -0500
Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv14829
Modified Files:
Tag: zconfig-schema-devel-branch
datatypes.py
Log Message:
Registry: Make it easier to supply an alternate set of "stock" data
types.
=== Packages/ZConfig/datatypes.py 1.1.2.15 => 1.1.2.16 ===
--- Packages/ZConfig/datatypes.py:1.1.2.15 Fri Dec 20 13:42:47 2002
+++ Packages/ZConfig/datatypes.py Fri Dec 20 14:54:59 2002
@@ -205,8 +205,10 @@
}
class Registry:
- def __init__(self):
- self._stock = stock_datatypes.copy()
+ def __init__(self, stock=None):
+ if stock is None:
+ stock = stock_datatypes.copy()
+ self._stock = stock
self._other = {}
def get(self, name):
@@ -219,7 +221,7 @@
def register(self, name, datatype):
if self._stock.has_key(name):
- raise ValueError("datatype name conflicts with built-in types: "
+ raise ValueError("datatype name conflicts with built-in type: "
+ `name`)
if self._other.has_key(name):
raise ValueError("datatype name already registered:" + `name`)