[Zope-Checkins] SVN: Zope/trunk/inst/generate_index.py Suppress case-flattening ConfigParser stupidity.
Tres Seaver
tseaver at palladion.com
Mon Apr 5 15:56:05 EDT 2010
Log message for revision 110518:
Suppress case-flattening ConfigParser stupidity.
Changed:
U Zope/trunk/inst/generate_index.py
-=-
Modified: Zope/trunk/inst/generate_index.py
===================================================================
--- Zope/trunk/inst/generate_index.py 2010-04-05 19:53:28 UTC (rev 110517)
+++ Zope/trunk/inst/generate_index.py 2010-04-05 19:56:05 UTC (rev 110518)
@@ -9,12 +9,12 @@
import urlparse
from xmlrpclib import Server
from ConfigParser import RawConfigParser as ConfigParser
+
+class CasePreservingConfigParser(ConfigParser):
+
+ def optionxform(self, option):
+ return option # don't flatten case!
-# packages containing upper-case letters
-upper_names = ('ClientForm', 'RestrictedPython', 'ZConfig', 'ZODB3', 'zLOG',
- 'Acquisition', 'DateTime', 'ExtensionClass', 'Persistence',
- 'ZopeUndo', 'Missing', 'MultiMapping', 'Record', 'ThreadLock', )
-
def write_index(package, version):
print >>sys.stderr, 'Package %s==%s' % (package, version)
dest_dir = os.path.join(dirname, package)
@@ -43,7 +43,7 @@
print >>fp, '</body></html>'
fp.close()
-CP = ConfigParser()
+CP = CasePreservingConfigParser()
CP.read(['versions.cfg'])
server = Server('http://pypi.python.org/pypi')
@@ -54,11 +54,5 @@
for package in CP.options('versions'):
- # options() returns all options in lowercase but
- # we must preserve the case for package names
- for name in upper_names:
- if name.lower() == package:
- package = name
- break
version = CP.get('versions', package)
write_index(package, version)
More information about the Zope-Checkins
mailing list