diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-02 13:18:47 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-04-02 13:18:47 +0000 |
| commit | 8b71fad1beb046182466c2fd70a9fc3294112b93 (patch) | |
| tree | 0b762cd20c75b4290787b95c6aecf69264860167 | |
| parent | c97f863ae067353e51beaa71d93cb5c0e73331dc (diff) | |
| download | docutils-8b71fad1beb046182466c2fd70a9fc3294112b93.tar.gz | |
reverted r4485 and r4486 (backport of PEP changes to maint. branch)
git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/docutils-0.4@4490 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 | ||||
| -rw-r--r-- | test/functional/expected/pep_html.html | 6 | ||||
| -rw-r--r-- | test/functional/expected/standalone_rst_html4css1.html | 2 | ||||
| -rw-r--r-- | test/functional/expected/standalone_rst_latex.tex | 2 | ||||
| -rw-r--r-- | test/functional/expected/standalone_rst_pseudoxml.txt | 2 | ||||
| -rwxr-xr-x | test/test_parsers/test_rst/test_interpreted.py | 2 | ||||
| -rwxr-xr-x | test/test_readers/test_pep/test_inline_markup.py | 14 |
9 files changed, 24 insertions, 30 deletions
diff --git a/docutils/parsers/rst/__init__.py b/docutils/parsers/rst/__init__.py index be49161a0..ff1d7b4f8 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/dev/peps/").', + '(default "http://www.python.org/peps/").', ['--pep-base-url'], - {'metavar': '<URL>', 'default': 'http://www.python.org/dev/peps/', + {'metavar': '<URL>', 'default': 'http://www.python.org/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 2fca91977..edaba2557 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' - pep_cvs_url = ('http://svn.python.org/view/*checkout*' - '/peps/trunk/pep-%04d.txt') + pep_url = 'pep-%04d.html' + pep_cvs_url = ('http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/' + 'python/nondist/peps/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 b23a543bd..a672e1c6d 100644 --- a/docutils/writers/pep_html/__init__.py +++ b/docutils/writers/pep_html/__init__.py @@ -79,32 +79,26 @@ class Writer(html4css1.Writer): if pyhome == '..': subs['pepindex'] = '.' else: - subs['pepindex'] = pyhome + '/dev/peps' + subs['pepindex'] = pyhome + '/peps' index = self.document.first_child_matching_class(nodes.field_list) header = self.document[index] - self.pepnum = header[0][1].astext() - subs['pep'] = self.pepnum + pepnum = header[0][1].astext() + subs['pep'] = pepnum if settings.no_random: subs['banner'] = 0 else: import random subs['banner'] = random.randrange(64) try: - subs['pepnum'] = '%04i' % int(self.pepnum) + subs['pepnum'] = '%04i' % int(pepnum) except ValueError: subs['pepnum'] = pepnum - self.title = header[1][1].astext() - subs['title'] = self.title + subs['title'] = header[1][1].astext() 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): diff --git a/test/functional/expected/pep_html.html b/test/functional/expected/pep_html.html index 1c4deafb3..a1e6d461a 100644 --- a/test/functional/expected/pep_html.html +++ b/test/functional/expected/pep_html.html @@ -21,7 +21,7 @@ to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE! border="0" width="150" height="35" /></a></td> <td class="textlinks" align="left"> [<b><a href="http://www.python.org/">Python Home</a></b>] -[<b><a href="http://www.python.org/dev/peps/">PEP Index</a></b>] +[<b><a href="http://www.python.org/peps/">PEP Index</a></b>] [<b><a href="http://www.python.org/peps/pep-0100.txt">PEP Source</a></b>] </td></tr></table> <div class="document"> @@ -35,7 +35,7 @@ to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE! </tr> <tr class="field"><th class="field-name">Version:</th><td class="field-body">42</td> </tr> -<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://svn.python.org/view/*checkout*/peps/trunk/pep-0100.txt">A long time ago.</a></td> +<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/peps/pep-0100.txt">A long time ago.</a></td> </tr> <tr class="field"><th class="field-name">Author:</th><td class="field-body">John Doe <john at example.org></td> </tr> @@ -45,7 +45,7 @@ to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE! </tr> <tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td> </tr> -<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="http://www.python.org/dev/peps/pep-0012">text/x-rst</a></td> +<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="http://www.python.org/peps/pep-0012.html">text/x-rst</a></td> </tr> <tr class="field"><th class="field-name">Created:</th><td class="field-body">01-Jun-2001</td> </tr> diff --git a/test/functional/expected/standalone_rst_html4css1.html b/test/functional/expected/standalone_rst_html4css1.html index 0ee1044e1..a3710e779 100644 --- a/test/functional/expected/standalone_rst_html4css1.html +++ b/test/functional/expected/standalone_rst_html4css1.html @@ -175,7 +175,7 @@ inline markup is also possible (although exceedingly ugly!) in <em>re</em><tt cl (generated by processing errors; this one is intentional). Here is a reference to the <a class="reference" href="#doctitle">doctitle</a> and the <a class="reference" href="#subtitle">subtitle</a>.</p> <p>The default role for interpreted text is <cite>Title Reference</cite>. Here are -some explicit interpreted text roles: a PEP reference (<a class="reference" href="http://www.python.org/dev/peps/pep-0287.html">PEP 287</a>); an +some explicit interpreted text roles: a PEP reference (<a class="reference" href="http://www.python.org/peps/pep-0287.html">PEP 287</a>); an RFC reference (<a class="reference" href="http://www.faqs.org/rfcs/rfc2822.html">RFC 2822</a>); a <sub>subscript</sub>; a <sup>superscript</sup>; and explicit roles for <em>standard</em> <strong>inline</strong> <tt class="docutils literal"><span class="pre">markup</span></tt>.</p> diff --git a/test/functional/expected/standalone_rst_latex.tex b/test/functional/expected/standalone_rst_latex.tex index 433b8d400..49d33a277 100644 --- a/test/functional/expected/standalone_rst_latex.tex +++ b/test/functional/expected/standalone_rst_latex.tex @@ -312,7 +312,7 @@ inline markup is also possible (although exceedingly ugly!) in \emph{re}\texttt{ reference to the \href{\#doctitle}{doctitle} and the \href{\#subtitle}{subtitle}. The default role for interpreted text is \titlereference{Title Reference}. Here are -some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/dev/peps/pep-0287.html}{PEP 287}); an +some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/peps/pep-0287.html}{PEP 287}); an RFC reference (\href{http://www.faqs.org/rfcs/rfc2822.html}{RFC 2822}); a $_{subscript}$; a $^{superscript}$; and explicit roles for \emph{standard} \textbf{inline} \texttt{markup}. diff --git a/test/functional/expected/standalone_rst_pseudoxml.txt b/test/functional/expected/standalone_rst_pseudoxml.txt index ed4562462..193f8c37c 100644 --- a/test/functional/expected/standalone_rst_pseudoxml.txt +++ b/test/functional/expected/standalone_rst_pseudoxml.txt @@ -470,7 +470,7 @@ Title Reference . Here are some explicit interpreted text roles: a PEP reference ( - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> + <reference refuri="http://www.python.org/peps/pep-0287.html"> PEP 287 ); an RFC reference ( diff --git a/test/test_parsers/test_rst/test_interpreted.py b/test/test_parsers/test_rst/test_interpreted.py index aa342d573..a5392d497 100755 --- a/test/test_parsers/test_rst/test_interpreted.py +++ b/test/test_parsers/test_rst/test_interpreted.py @@ -182,7 +182,7 @@ totest['references'] = [ """\ <document source="test data"> <paragraph> - <reference refuri="http://www.python.org/dev/peps/pep-0000.html"> + <reference refuri="http://www.python.org/peps/pep-0000.html"> PEP 0 """], ["""\ diff --git a/test/test_readers/test_pep/test_inline_markup.py b/test/test_readers/test_pep/test_inline_markup.py index 80b100593..4965af3d1 100755 --- a/test/test_readers/test_pep/test_inline_markup.py +++ b/test/test_readers/test_pep/test_inline_markup.py @@ -30,10 +30,10 @@ and RFC 2822 (which obsoletes RFC822 and RFC-733). <document source="test data"> <paragraph> See \n\ - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> + <reference refuri="http://www.python.org/peps/pep-0287.html"> PEP 287 ( - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> + <reference refuri="http://www.python.org/peps/pep-0287.html"> pep-0287.txt ), and \n\ @@ -61,7 +61,7 @@ RFC <paragraph> References split across lines: <paragraph> - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> + <reference refuri="http://www.python.org/peps/pep-0287.html"> PEP 287 <paragraph> @@ -72,18 +72,18 @@ RFC ["""\ Test PEP-specific implicit references before a URL: -PEP 287 (http://www.python.org/dev/peps/pep-0287.html), RFC 2822. +PEP 287 (http://www.python.org/peps/pep-0287.html), RFC 2822. """, """\ <document source="test data"> <paragraph> Test PEP-specific implicit references before a URL: <paragraph> - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> + <reference refuri="http://www.python.org/peps/pep-0287.html"> PEP 287 ( - <reference refuri="http://www.python.org/dev/peps/pep-0287.html"> - http://www.python.org/dev/peps/pep-0287.html + <reference refuri="http://www.python.org/peps/pep-0287.html"> + http://www.python.org/peps/pep-0287.html ), \n\ <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> RFC 2822 |
