Mercurial > mozilla > hg > DocumentIt
changeset 0:665b2ae2ecc6
stub project for DocumentIt
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 01 Aug 2011 12:00:51 -0700 |
parents | |
children | 53c7f9c7dfb6 |
files | README.txt document_it.py setup.py |
diffstat | 3 files changed, 100 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,4 @@ +DocumentIt +========== + +Mirror documentation to https://developer.mozilla.org/en/Mozmill
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/document_it.py Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +""" +update documentation for Mozmill +""" + +import os +import sys +import urllib2 +from optparse import OptionParser + +# necessary imports +try: + import markdown +except ImportError: + raise ImportError("markdown is not installed, run (e.g.):\neasy_install Markdown") + +DEST='http://developer.mozilla.org/' +DIR=os.path.dirname(os.path.abspath(__file__)) +README=['README.md', 'README.txt', 'README'] + +def find_readme(directory): + """find a README file in a directory""" + for name in README: + path = os.path.join(directory, name) + if os.path.exists(path): + return path + +def main(args=sys.argv[1:]): + + # parse command line options + usage = '%prog [options]' + parser = OptionParser(usage=usage, description=__doc__) + parser.add_option('-d', '--directory', dest='directory', + help='render the documentation to this directory') + parser.add_option('-p', '--package', dest='packages', + action='append', + help='package to operate on') + parser.add_option('--list', dest='list', action='store_true', + help="list packages") + options, args = parser.parse_args(args) + + # find packages + packages = options.__dict__.pop('packages') + if not packages: + packages = [i for i in os.listdir(DIR) + if os.path.isdir(os.path.join(DIR, i)) + and find_readme(os.path.join(DIR, i))] + if options.list: + for i in packages: + print i + + # run setup_development.py in this directory + # to ensure documentation is up to date + # TODO; as yet unneeded + + # render and upload READMEs + # TODO + +if __name__ == '__main__': + main()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,35 @@ +import os +from setuptools import setup + +try: + here = os.path.dirname(os.path.abspath(__file__)) + description = file(os.path.join(here, 'README.txt')).read() +except IOError: + description = None + +version = '0.0' + +deps = [] + +setup(name='document_it', + version=version, + description="mirror text documentation to MDN", + long_description=description, + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='mozilla', + author='Jeff Hammel', + author_email='jhammel@mozilla.com', + url='http://k0s.org/mozilla/hg/DocumentIt', + license='MPL', + py_modules=['document_it'], + packages=[], + include_package_data=True, + zip_safe=False, + install_requires=deps, + entry_points=""" + # -*- Entry points: -*- + [console_scripts] + document_it = document_it:main + """, + ) +