diff options
author | tailor <cygnus@janrain.com> | 2006-03-03 19:16:42 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-03-03 19:16:42 +0000 |
commit | f2badbb2e6f622186468115847d66c14c4549b57 (patch) | |
tree | 3f186bdcea108db52996b294ea9f8de2dbcea102 | |
parent | cfb77e2bbc57bd9f7b2c87e4dafbbbf47026796a (diff) | |
download | php-openid-f2badbb2e6f622186468115847d66c14c4549b57.zip php-openid-f2badbb2e6f622186468115847d66c14c4549b57.tar.gz php-openid-f2badbb2e6f622186468115847d66c14c4549b57.tar.bz2 |
[project @ Added docs to xmlconfig.py and updated packagexml.py to include docs in output XML]
-rw-r--r-- | admin/package.xml | 3 | ||||
-rw-r--r-- | admin/packagexml.py | 33 | ||||
-rw-r--r-- | admin/xmlconfig.py | 35 |
3 files changed, 62 insertions, 9 deletions
diff --git a/admin/package.xml b/admin/package.xml index 7f78305..15182cb 100644 --- a/admin/package.xml +++ b/admin/package.xml @@ -7,7 +7,7 @@ http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>%(package_name)s</name> - <channel>pear.php.net</channel> + <uri>%(uri)s</uri> <summary>%(package_summary)s</summary> <description> %(package_description)s @@ -42,6 +42,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> <optional> <package> <name>PHPUnit</name> + <channel>pear.php.net</channel> <min>1.1.1</min> </package> <package> diff --git a/admin/packagexml.py b/admin/packagexml.py index aea0929..0591b6d 100644 --- a/admin/packagexml.py +++ b/admin/packagexml.py @@ -17,7 +17,7 @@ def makeLeadXML(leads): INDENT_STRING = " " -def buildContentsXMLFordir(dir_or_file, roles, depth=0): +def buildContentsXMLFordir(dir_or_file, roles, depth=0, dir_role=None, all_files=False): """ Returns a list of strings, each of which is either a <file> XML element for the given file or a <dir> element which contains other @@ -26,10 +26,14 @@ def buildContentsXMLFordir(dir_or_file, roles, depth=0): try: entries = os.listdir(dir_or_file) - lines = ['%s<dir name="%s">' % (INDENT_STRING * depth, os.path.basename(dir_or_file))] + dir_role_s = '' + if dir_role: + dir_role_s = ' role="%s"' % (dir_role) + lines = ['%s<dir name="%s"%s>' % (INDENT_STRING * depth, os.path.basename(dir_or_file), + dir_role_s)] for entry in entries: - lines += buildContentsXMLFordir(dir_or_file + os.sep + entry, roles, depth + 1) + lines += buildContentsXMLFordir(dir_or_file + os.sep + entry, roles, depth + 1, dir_role, all_files) lines.append('%s</dir>' % (INDENT_STRING * depth)) @@ -38,21 +42,32 @@ def buildContentsXMLFordir(dir_or_file, roles, depth=0): try: extension = dir_or_file.split(".")[-1] except: - return [] + if not all_files: + return [] if extension in roles: # Ends in an extension we care about return ['%s<file name="%s" role="%s" />' % (INDENT_STRING * depth, os.path.basename(dir_or_file), roles[extension])] + elif all_files: + return ['%s<file name="%s" />' % + (INDENT_STRING * depth, os.path.basename(dir_or_file))] else: + print "FOOB for %s %s" % (all_files, dir_or_file) return [] def buildContentsXML(roles, *dirs): - lines = ['<dir name="/">'] + lines = [] for directory in dirs: lines.append("\n".join(buildContentsXMLFordir(directory, roles, 1))) - lines.append('</dir>') + return "\n".join(lines) + +def buildDocsXML(*dirs): + lines = [] + + for directory in dirs: + lines.append("\n".join(buildContentsXMLFordir(directory, {}, 1, 'doc', all_files=True))) return "\n".join(lines) @@ -82,10 +97,14 @@ if __name__ == "__main__": data = xmlconfig.__dict__.copy() - data['contents'] = buildContentsXML({'php': 'php'}, *xmlconfig.contents_dirs) + contents = '<dir name="/">\n' + buildContentsXML({'php': 'php'}, *xmlconfig.contents_dirs) + \ + "\n" + buildDocsXML(*xmlconfig.docs_dirs) + '\n </dir>' + + data['contents'] = contents data['leads'] = makeLeadXML(xmlconfig.leads) data['date'] = time.strftime("%Y-%m-%d") data['version'] = version + data['uri'] = "%s%s-%s.tgz" % (data['package_base_uri'], data['package_name'], version) template_data = template_f.read() print template_data % data diff --git a/admin/xmlconfig.py b/admin/xmlconfig.py index 5744a8b..dc3cf44 100644 --- a/admin/xmlconfig.py +++ b/admin/xmlconfig.py @@ -5,6 +5,8 @@ package.xml file. Use the 'packagexml.py' program to generate a package.xml file for a release of this library. """ +# This is a list of dicts describing the project leads. This will be +# used to generate <lead> XML elements. leads = [ {'name': 'Jonathan Daugherty', 'user': 'cygnus', @@ -16,12 +18,43 @@ leads = [ 'active': 'yes'} ] +# This is the XML file containing %(...)s formatters. You'll probably +# never want to change this unless you make a copy of package.xml and +# change it somehow. template = 'package.xml' -package_name = 'OpenID' +# The package name. +package_name = 'Auth_OpenID' + +# The package description. package_description = 'An implementation of the OpenID single sign-on authentication protocol.' + +# Package summary. package_summary = 'PHP OpenID' + +# License string. license_name = 'LGPL' + +# License URI. license_uri = 'http://www.gnu.org/copyleft/lesser.txt' + +# Director(ies) containing package source, relative to the admin/ +# directory. All .php files in these directories will be included in +# the <contents> element of the output XML and will be assigned the +# role 'php'. contents_dirs = ['../Auth'] + +# Director(ies) containing package documentation. All files and +# subdirectories in these directories will be included in the +# <contents> element in the output XML and will be assigned the role +# 'doc'. +docs_dirs = ['../doc'] + +# The HTTP package base URI. This is the place on the web where the +# PEAR-installable tarballs will live, and this (plus the package +# tarball name) will be the URL that users pass to "pear install". +package_base_uri = 'http://localhost/' + +# The release stability. Maybe this should be a commandline parameter +# since it might differ from release to release. release_stability = 'stable' |