#!/usr/bin/env python import os import sys sys.stdout = file('index.html', 'w') HEAD = """ Mac OS X Python Packages
Support the maintenance of this repository:
""" # PIL http://www.pythonware.com/products/pil/ http://undefined.org/python/Imaging-1.1.5b3-py2.3-macosx10.3.zip 927789970f719966e66ceb57fffa7a49 f = file('packages.txt').readlines() sections = [] cursection = None for line in f: if line.startswith('='): section = line.strip('=').strip() cursection = [] sections.append((section, cursection)) elif line.startswith('#'): pass else: line = line.strip() if line: cursection.append(line.split()) print HEAD def maplower(a): return [s.lower() for s in a] for section, packages in sections: packages.sort(lambda a,b:cmp(maplower(a), maplower(b))) print '
' print '

%s

' % (section,) for (name, home, dist, checksum) in packages: print '
' print '' print '

' print '%s' % (home, name) print '
' print '%s (MD5: %s)' % (dist, os.path.basename(dist), checksum) print '

' print '' print '
' print '

bob@redivi.com

' print """
""" print ''