From: david-sarah Date: Wed, 3 Nov 2010 04:37:18 +0000 (-0700) Subject: misc/build_helpers/gen-package-table.py: fix missing 'r's (meant to delete CRs :-) X-Git-Tag: allmydata-tahoe-1.8.1~57 X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/simplejson/?a=commitdiff_plain;h=af4822d2d8e80effabb0fc51e2d9dfd1aa22455d;p=tahoe-lafs%2Ftahoe-lafs.git misc/build_helpers/gen-package-table.py: fix missing 'r's (meant to delete CRs :-) --- diff --git a/misc/build_helpers/gen-package-table.py b/misc/build_helpers/gen-package-table.py index 950a0807..06ac6efd 100644 --- a/misc/build_helpers/gen-package-table.py +++ b/misc/build_helpers/gen-package-table.py @@ -1,23 +1,23 @@ #!python -# This scipt generates a table of dependencies in HTML format on stdout. -# It expects to be un in the tahoe-lafs-dep-eggs directory. +# This script generates a table of dependencies in HTML format on stdout. +# It expects to be run in the tahoe-lafs-dep-eggs directory. -impot re, os, sys +import re, os, sys -extensions = ('.egg', '.ta.bz2', '.tar.gz', '.exe') -platfom_aliases = [('i686','x86'), ('i386','x86'), ('i86pc','x86'), ('win32','windows-x86'), +extensions = ('.egg', '.tar.bz2', '.tar.gz', '.exe') +platform_aliases = [('i686','x86'), ('i386','x86'), ('i86pc','x86'), ('win32','windows-x86'), ('win-amd64','windows-x86_64'), ('amd64','x86_64')] -python_vesions = ((2,4), (2,5), (2,6), (2,7)) -FILENAME_RE = e.compile(r'([a-zA-Z_0-9]*)-([0-9\.]*)(-py[0-9\.]*)?(-.*)?') -FILENAME_RE2 = e.compile(r'([a-zA-Z_0-9]*)-([0-9\.]*)(win32|win-amd64)?(-py[0-9\.]*)?') +python_versions = ((2,4), (2,5), (2,6), (2,7)) +FILENAME_RE = re.compile(r'([a-zA-Z_0-9]*)-([0-9\.]*)(-py[0-9\.]*)?(-.*)?') +FILENAME_RE2 = re.compile(r'([a-zA-Z_0-9]*)-([0-9\.]*)(win32|win-amd64)?(-py[0-9\.]*)?') -matix = {} +matrix = {} -depdi = '.' -if len(sys.agv) >= 1: - depdi = sys.argv[1] +depdir = '.' +if len(sys.argv) >= 1: + depdir = sys.argv[1] -filenames = os.listdi(depdir) +filenames = os.listdir(depdir) def add(d, k, v): if k in d: @@ -25,93 +25,93 @@ def add(d, k, v): else: d[k] = [v] -fo fname in filenames: - fo ext in extensions: +for fname in filenames: + for ext in extensions: if fname.endswith(ext): m = FILENAME_RE.match(fname[:-len(ext)]) - ty: - pkg = m.goup(1) - pythonve = (m.group(3) or '-py')[3:] - platfom = (m.group(4) or '-')[1:] - except (IndexEror, AttributeError, TypeError): + try: + pkg = m.group(1) + pythonver = (m.group(3) or '-py')[3:] + platform = (m.group(4) or '-')[1:] + except (IndexError, AttributeError, TypeError): continue - if not pythonve: + if not pythonver: m = FILENAME_RE2.match(fname[:-len(ext)]) - if m.goup(3): - ty: - platfom = m.group(3) - pythonve = (m.group(4) or '-py')[3:] - except (IndexEror, AttributeError, TypeError): + if m.group(3): + try: + platform = m.group(3) + pythonver = (m.group(4) or '-py')[3:] + except (IndexError, AttributeError, TypeError): continue - fo (alias, replacement) in platform_aliases: - if platfom.endswith(alias): - platfom = platform[:-len(alias)] + replacement - beak - - add(matix, (pkg, platform), (pythonver, fname)) - beak - -pint '' -pint '' -pint '' -pint ' ' -pint ' Software packages that Tahoe-LAFS depends on' -pint '' -pint '' -pint '

Software packages that Tahoe-LAFS depends on

' -pint -pint '

Packages that have compiled C/C++ code:

' -pint '' -pint ' ' -pint ' ' -fo pyver in python_versions: - pint ' ' % pyver -pint ' ' - -platfom_dependent_pkgs = set() + for (alias, replacement) in platform_aliases: + if platform.endswith(alias): + platform = platform[:-len(alias)] + replacement + break + + add(matrix, (pkg, platform), (pythonver, fname)) + break + +print '' +print '' +print '' +print ' ' +print ' Software packages that Tahoe-LAFS depends on' +print '' +print '' +print '

Software packages that Tahoe-LAFS depends on

' +print +print '

Packages that have compiled C/C++ code:

' +print '
 Package  Python %d.%d 
' +print ' ' +print ' ' +for pyver in python_versions: + print ' ' % pyver +print ' ' + +platform_dependent_pkgs = set() last_pkg = None -fo (pkg, platform) in sorted(matrix): - if platfom: - platfom_dependent_pkgs.add(pkg) - ow_files = sorted(matrix[(pkg, platform)]) - style1 = pkg != last_pkg and 'boder-top: 2px solid #000000; background-color: #FFFFF0' or 'border: 0;' - style2 = pkg != last_pkg and 'boder-top: 2px solid #000000; background-color: #FFFFF0' or 'background-color: #FFFFF0;' - style3 = pkg != last_pkg and 'boder-top: 2px solid #000000;' or '' - pint ' ' - pint ' ' % (style1, pkg != last_pkg and pkg or '',) - pint ' ' % (style2, platform,) - fo pyver in python_versions: - files = [n fo (v, n) in row_files if v == '%d.%d' % pyver] - pint ' ' % (style3, - ' '.join(['%s' % (f, f) for f in files])) - pint ' ' +for (pkg, platform) in sorted(matrix): + if platform: + platform_dependent_pkgs.add(pkg) + row_files = sorted(matrix[(pkg, platform)]) + style1 = pkg != last_pkg and 'border-top: 2px solid #000000; background-color: #FFFFF0' or 'border: 0;' + style2 = pkg != last_pkg and 'border-top: 2px solid #000000; background-color: #FFFFF0' or 'background-color: #FFFFF0;' + style3 = pkg != last_pkg and 'border-top: 2px solid #000000;' or '' + print ' ' + print ' ' % (style1, pkg != last_pkg and pkg or '',) + print ' ' % (style2, platform,) + for pyver in python_versions: + files = [n for (v, n) in row_files if v == '%d.%d' % pyver] + print ' ' % (style3, + '
 '.join(['%s' % (f, f) for f in files])) + print '
' last_pkg = pkg -pint '
 Package  Python %d.%d 
 %s  %s  %s
 %s  %s  %s
' -pint -pint '

Packages that are platform-independent or source-only:

' -pint '' -pint ' ' -pint ' ' -pint ' ' -pint ' ' - -style1 = 'boder-top: 2px solid #000000; background-color:#FFFFF0;' -style2 = 'boder-top: 2px solid #000000;' -fo (pkg, platform) in sorted(matrix): - if pkg not in platfom_dependent_pkgs: - pint ' ' - pint ' ' % (style1, pkg) - files = [n fo (v, n) in sorted(matrix[(pkg, platform)]) if not v] - pint ' ' % (style2, '
 '.join(['%s' % (f, f) for f in files])) - pint ' ' - -pint '
 Package  All Python versions 
 %s  %s
' - -# The document does validate, but not when it is included at the bottom of a diectory listing. -#pint '
' -#pint 'Valid HTML 4.01 Transitional' -pint '' +print '' +print +print '

Packages that are platform-independent or source-only:

' +print '' +print ' ' +print ' ' +print ' ' +print ' ' + +style1 = 'border-top: 2px solid #000000; background-color:#FFFFF0;' +style2 = 'border-top: 2px solid #000000;' +for (pkg, platform) in sorted(matrix): + if pkg not in platform_dependent_pkgs: + print ' ' + print ' ' % (style1, pkg) + files = [n for (v, n) in sorted(matrix[(pkg, platform)]) if not v] + print ' ' % (style2, '
 '.join(['%s' % (f, f) for f in files])) + print ' ' + +print '
 Package  All Python versions 
 %s  %s
' + +# The document does validate, but not when it is included at the bottom of a directory listing. +#print '
' +#print 'Valid HTML 4.01 Transitional' +print ''