[Checkins] SVN: groktoolkit/trunk/doc/ releases will be a single document, remove the directory
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Mon Feb 7 09:48:10 EST 2011
Log message for revision 120181:
releases will be a single document, remove the directory
Changed:
U groktoolkit/trunk/doc/Makefile
U groktoolkit/trunk/doc/docindex.template
D groktoolkit/trunk/doc/releases/
U groktoolkit/trunk/doc/scripts/update-releaseinfo.py
-=-
Modified: groktoolkit/trunk/doc/Makefile
===================================================================
--- groktoolkit/trunk/doc/Makefile 2011-02-07 12:41:22 UTC (rev 120180)
+++ groktoolkit/trunk/doc/Makefile 2011-02-07 14:48:10 UTC (rev 120181)
@@ -3,7 +3,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
-SPHINXBUILD = sphinx-build
+SPHINXBUILD = ../bin/sphinxpython ../bin/sphinx-build
PAPER =
BUILDDIR = _build
@@ -14,28 +14,34 @@
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+all: releaseinfo html
+
help:
@echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " releaseinfo to generate the releases information source files"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
+releaseinfo:
+ ../bin/sphinxpython scripts/update-releaseinfo.py
+
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
Modified: groktoolkit/trunk/doc/docindex.template
===================================================================
--- groktoolkit/trunk/doc/docindex.template 2011-02-07 12:41:22 UTC (rev 120180)
+++ groktoolkit/trunk/doc/docindex.template 2011-02-07 14:48:10 UTC (rev 120181)
@@ -11,32 +11,31 @@
<p><strong>Sections</strong></p>
<table class="contentstable" align="center"><tr>
<td width="50%">
- <p class="biglink"><a class="biglink" href="{{ pathto("tutorial") }}"
- >Grok Tutorial</a><br>
- <span class="linkdescr">Get started with Grok.</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("tutorial") }}">Grok Tutorial</a><br>
+ <span class="linkdescr">Get started with Grok.</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">The Grok Reference</a><br>
- <span class="linkdescr">Describes syntax and package elements.</span></p>
+ <span class="linkdescr">Describes syntax and package elements.</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("grok_overview") }}"
- >Grok Developer Notes</a><br>
- <span class="linkdescr">Overview of what's in Grok and how to use it.</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("grok_overview") }}">Grok Developer Notes</a><br>
+ <span class="linkdescr">Overview of what's in Grok and how to use it.</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("naming_conventions") }}">Naming Conventions</a><br>
- <span class="linkdescr">How to name your stuff correctly.</span></p>
+ <span class="linkdescr">How to name your stuff correctly.</span></p>
</td><td width="50%">
- <p class="biglink"><a class="biglink" href="{{ pathto("releases/index") }}"
- >Grok Releases</a><br>
- <span class="linkdescr">Changes made in each Grok release.</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("packages") }}">Grok Packages</a><br>
+ <span class="linkdescr">How to upgrade your project to a new version of Grok.</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("upgrade") }}"
- >Upgrade notes</a><br>
- <span class="linkdescr">How to upgrade your project to a new version of the Grok Toolkit.</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("upgrade") }}">Upgrade notes</a><br>
+ <span class="linkdescr">How to upgrade your project to a new version of Grok.</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("developing_grok") }}">Developing Grok</a><br>
- <span class="linkdescr">Notes for developers <strong>of</strong> Grok.</span></p>
+ <span class="linkdescr">Notes for developers <strong>of</strong> Grok.</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("releases") }}">Grok Releases</a><br>
+ <span class="linkdescr">A history of Grok releases.</span></p>
+
</td></tr>
</table>
Modified: groktoolkit/trunk/doc/scripts/update-releaseinfo.py
===================================================================
--- groktoolkit/trunk/doc/scripts/update-releaseinfo.py 2011-02-07 12:41:22 UTC (rev 120180)
+++ groktoolkit/trunk/doc/scripts/update-releaseinfo.py 2011-02-07 14:48:10 UTC (rev 120181)
@@ -3,26 +3,26 @@
# and heavily modified.
import ConfigParser
-import StringIO
import os
import os.path
+import py.path
import socket
+import StringIO
+import sys
import urllib2
import xml.etree.ElementTree
-import py.path
socket.setdefaulttimeout(10)
TABLE_HEADER = """\
.. list-table::
:class: packagelist
- :widths: 25 10 40 25
+ :widths: 25 10 65
:header-rows: 1
* - Name
- Version
- - Description
- - Links\
+ - Description\
"""
PACKAGE_LINE_BASE = """
@@ -31,21 +31,15 @@
- %(description)s\
"""
-DEPENDENCY_PACKAGE_LINE = PACKAGE_LINE_BASE + """
- - \
-"""
+PACKAGE_LINE = PACKAGE_LINE_BASE
-PACKAGE_LINE = PACKAGE_LINE_BASE + """
- - `Bugs <http://bugs.launchpad.net/%(name)s>`_ |
- `Subversion <http://svn.zope.org/%(name)s>`_ \
-"""
-
GENERATED_WARNING = """\
.. This file is generated. Please do not edit manually or check in.
"""
DOAP_NS = 'http://usefulinc.com/ns/doap#'
GROKTOOLKIT_ROOT = py.path.svnurl('http://svn.zope.org/repos/main/groktoolkit')
+TAGS_URL = GROKTOOLKIT_ROOT/'tags'
def package_list(
packages, config, out, line=PACKAGE_LINE):
@@ -58,9 +52,10 @@
doap_xml = StringIO.StringIO(doap_xml.replace('\f', ''))
doap = xml.etree.ElementTree.ElementTree()
doap.parse(doap_xml)
- description = doap.find('//{%s}shortdesc' % DOAP_NS).text
+ description = ' '.join(
+ doap.find('//{%s}shortdesc' % DOAP_NS).text.splitlines())
homepage = 'http://pypi.python.org/pypi/%s/%s' % (package, version)
- print >>output, line % dict(
+ print >>out, line % dict(
name=package, homepage=homepage,
description=description, version=version)
print >>out
@@ -73,50 +68,62 @@
result = filter(None, map(str.strip, result))
return result
-releases = []
-tags_url = GROKTOOLKIT_ROOT/'tags'
+def get_releases():
+ tags = TAGS_URL.listdir()
+ tags.reverse()
+ releases = []
+ for tag in tags:
+ releases.append((tag.basename, tag))
+ break
+ return releases
-for tag_url in tags_url.listdir().reverse():
- releases.append((tag_url.basename, tag_url))
+def write_package_lists(releases, path):
+ for release, location in releases:
+ print 'Writing package list for "%s"' % release
-for release, location in releases:
- print 'Writing package list for "%s"' % release
+ config = ConfigParser.RawConfigParser()
+ config.optionxform = str
+ fp = StringIO.StringIO((location/'grok.cfg').read())
+ config.readfp(fp)
- config = ConfigParser.RawConfigParser()
- config.optionxform = str
- fp = StringIO.StringIO((location/'grok.cfg').read())
- config.readfp(fp)
+ output = open(os.path.join(path, 'packages-%s.rst' % release), 'w')
- output = open(
- os.path.join('doc', 'releases', 'packages-%s.rst' % release), 'w')
+ print >>output, GENERATED_WARNING
- print >>output, GENERATED_WARNING
+ heading = 'Grok %s packages' % release
+ print >>output, '=' * len(heading)
+ print >>output, heading
+ print >>output, '=' * len(heading)
- heading = 'Grok %s packages' % release
- print >>output, heading
- print >>output, '=' * len(heading)
+ ztk_version = '1.1'
+ print >>output, 'Zope Toolkit %s' % ztk_version
+ print >>output, '------------------------------'
+ print >>output, '`Overview of ZTK-%s <http://docs.zope.org/zopetoolkit/releases/overview-%s.html>`' % (ztk_version, ztk_version)
- included = packages(config, 'included')
- package_list(included, config, output)
+ print >>output, 'Packages'
+ print >>output, '--------'
+ included = packages(config, 'included')
+ package_list(included, config, output)
- deprecating = packages(config, 'deprecating')
- if deprecating:
- print >>output, 'Deprecating'
- print >>output, '-----------'
- package_list(deprecating, versions, output)
+ deprecating = packages(config, 'deprecating')
+ if deprecating:
+ print >>output, 'Deprecating'
+ print >>output, '-----------'
+ package_list(deprecating, versions, output)
- print >>output, 'Dependencies'
- print >>output, '------------'
- all = config.options('versions')
- dependencies = set(all) - (set(included) | set(deprecating))
- package_list(dependencies, config, output, DEPENDENCY_PACKAGE_LINE)
- output.close()
+ print >>output, 'Other dependencies'
+ print >>output, '------------------'
+ all = config.options('versions')
+ dependencies = (set(all) - set(included)) - set(deprecating)
+ package_list(dependencies, config, output)
+ output.close()
-print "Writing overview"
+def write_overview(releases, path):
+ print "Writing overview"
-output = open(os.path.join('doc', 'releases', 'index.rst'), 'w')
-print >>output, GENERATED_WARNING
-print >>output, """
+ output = open(os.path.join(path, 'index.rst'), 'w')
+ print >>output, GENERATED_WARNING
+ print >>output, """
Releases
========
@@ -128,21 +135,17 @@
:maxdepth: 1
"""
+ for release, location in releases:
+ print >>output, """
+ overview-%s""" % release
-for release, location in releases:
- print >>output, """
- overview-%s\
-""" % release
-
-
-for release, location in releases:
- overview = open(
- os.path.join('doc', 'releases', 'overview-%s.rst' % release), 'w')
- print >>overview, GENERATED_WARNING
- title = "Grok %s" % release
- print >>overview, title
- print >>overview, "=" * len(title)
- print >>overview, """
+ for release, location in releases:
+ overview = open(os.path.join(path, 'overview-%s.rst' % release), 'w')
+ print >>overview, GENERATED_WARNING
+ title = "Grok %s" % release
+ print >>overview, title
+ print >>overview, "=" * len(title)
+ print >>overview, """
This document covers major changes in this release that can lead to
backward-incompatibilities and explains what to look out for when updating.
@@ -156,5 +159,11 @@
""" % release
- #overview.write((location/'README.txt').read())
- overview.close()
+ #overview.write((location/'README.txt').read())
+ overview.close()
+
+if __name__ == '__main__':
+ releases = get_releases()
+ path = os.path.abspath(os.path.join('releases'))
+ write_package_lists(releases, path)
+ write_overview(releases, path)
More information about the checkins
mailing list