diff options
author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-01 14:16:40 +0000 |
---|---|---|
committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-01 14:16:40 +0000 |
commit | 32f410ac4113c5842c6640cfb591b4e0cfc48af5 (patch) | |
tree | e76a3376a65ebb5ea8e4698e4bc307551c4dd724 | |
parent | 51725d0d05b850e3d2484d543e040883d2208c94 (diff) | |
download | docutils-32f410ac4113c5842c6640cfb591b4e0cfc48af5.tar.gz |
--- MERGE: merged r4443 to maintenance branch; original log message:
support for new python.org and pep2pyramid.py
git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/docutils-0.4@4485 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | docutils/parsers/rst/__init__.py | 4 | ||||
-rw-r--r-- | docutils/transforms/peps.py | 6 | ||||
-rw-r--r-- | docutils/writers/pep_html/__init__.py | 16 |
3 files changed, 16 insertions, 10 deletions
diff --git a/docutils/parsers/rst/__init__.py b/docutils/parsers/rst/__init__.py index ff1d7b4f8..be49161a0 100644 --- a/docutils/parsers/rst/__init__.py +++ b/docutils/parsers/rst/__init__.py @@ -92,9 +92,9 @@ class Parser(docutils.parsers.Parser): ['--pep-references'], {'action': 'store_true', 'validator': frontend.validate_boolean}), ('Base URL for PEP references ' - '(default "http://www.python.org/peps/").', + '(default "http://www.python.org/dev/peps/").', ['--pep-base-url'], - {'metavar': '<URL>', 'default': 'http://www.python.org/peps/', + {'metavar': '<URL>', 'default': 'http://www.python.org/dev/peps/', 'validator': frontend.validate_url_trailing_slash}), ('Recognize and link to standalone RFC references (like "RFC 822").', ['--rfc-references'], diff --git a/docutils/transforms/peps.py b/docutils/transforms/peps.py index edaba2557..2fca91977 100644 --- a/docutils/transforms/peps.py +++ b/docutils/transforms/peps.py @@ -33,9 +33,9 @@ class Headers(Transform): default_priority = 360 - pep_url = 'pep-%04d.html' - pep_cvs_url = ('http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/' - 'python/nondist/peps/pep-%04d.txt') + pep_url = 'pep-%04d' + pep_cvs_url = ('http://svn.python.org/view/*checkout*' + '/peps/trunk/pep-%04d.txt') rcs_keyword_substitutions = ( (re.compile(r'\$' r'RCSfile: (.+),v \$$', re.IGNORECASE), r'\1'), (re.compile(r'\$[a-zA-Z]+: (.+) \$$'), r'\1'),) diff --git a/docutils/writers/pep_html/__init__.py b/docutils/writers/pep_html/__init__.py index a672e1c6d..b23a543bd 100644 --- a/docutils/writers/pep_html/__init__.py +++ b/docutils/writers/pep_html/__init__.py @@ -79,26 +79,32 @@ class Writer(html4css1.Writer): if pyhome == '..': subs['pepindex'] = '.' else: - subs['pepindex'] = pyhome + '/peps' + subs['pepindex'] = pyhome + '/dev/peps' index = self.document.first_child_matching_class(nodes.field_list) header = self.document[index] - pepnum = header[0][1].astext() - subs['pep'] = pepnum + self.pepnum = header[0][1].astext() + subs['pep'] = self.pepnum if settings.no_random: subs['banner'] = 0 else: import random subs['banner'] = random.randrange(64) try: - subs['pepnum'] = '%04i' % int(pepnum) + subs['pepnum'] = '%04i' % int(self.pepnum) except ValueError: subs['pepnum'] = pepnum - subs['title'] = header[1][1].astext() + self.title = header[1][1].astext() + subs['title'] = self.title subs['body'] = ''.join( self.body_pre_docinfo + self.docinfo + self.body) subs['body_suffix'] = ''.join(self.body_suffix) self.output = template % subs + def assemble_parts(self): + html4css1.Writer.assemble_parts(self) + self.parts['title'] = [self.title] + self.parts['pepnum'] = self.pepnum + class HTMLTranslator(html4css1.HTMLTranslator): |