[Zope-Checkins] CVS: Zope2 - __init__.py:1.1.2.5
andreas@digicool.com
andreas@digicool.com
Wed, 16 May 2001 12:24:05 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/Products/PluginIndexes/TextIndex/Splitter
In directory korak.digicool.com:/tmp/cvs-serv4313/TextIndex/Splitter
Modified Files:
Tag: ajung-dropin-registry
__init__.py
Log Message:
update
--- Updated File __init__.py in package Zope2 --
--- __init__.py 2001/05/16 16:09:13 1.1.2.4
+++ __init__.py 2001/05/16 16:24:05 1.1.2.5
@@ -1,17 +1,22 @@
import os,sys,exceptions
-availableSplitters = ["Splitter","ISO_8859_1_Splitter"]
+availableSplitters = (
+ ("Splitter" , "Zope Default Splitter"),
+ ("ISO_8859_1_Splitter" , "Werner Strobles ISO Splitter")
+)
+splitterNames = map(lambda x: x[0],availableSplitters)
+
def getSplitter(name=None):
- if not name in availableSplitters:
+ if not name in splitterNames:
raise exceptions.RuntimeError,"No such splitter '%s'" % name
- if not name: name = availableSplitters[0]
- exec( "from %s import Splitter as %s" % (name,name))
+ if not name: name = splitterNames[0]
+ if not vars().has_key(name):
+ exec( "from %s import Splitter as %s" % (name,name))
return vars()[name]
-exec( "from %s import Splitter as DefaultSplitter" % availableSplitters[0])