pytho****@googl*****
pytho****@googl*****
2011年 11月 12日 (土) 02:48:34 JST
3 new revisions: Revision: 018a06e07183 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:41:02 2011 Log: indexcontent を更新 http://code.google.com/p/python-doc-ja/source/detail?r=018a06e07183 Revision: c687e862a292 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:46:18 2011 Log: Update sphinxext http://code.google.com/p/python-doc-ja/source/detail?r=c687e862a292 Revision: 7071be001d84 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:47:58 2011 Log: Update conf.py http://code.google.com/p/python-doc-ja/source/detail?r=7071be001d84 ============================================================================== Revision: 018a06e07183 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:41:02 2011 Log: indexcontent を更新 http://code.google.com/p/python-doc-ja/source/detail?r=018a06e07183 Deleted: /tools/sphinxext/indexcontent.html.diff /tools/sphinxext/indexcontent.html.diff.html Modified: /tools/sphinxext/indexcontent.html ======================================= --- /tools/sphinxext/indexcontent.html.diff Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,30 +0,0 @@ -@@ -1,27 +1,27 @@ - {% extends "defindex.html" %} - {% block tables %} - <p><strong>Parts of the documentation:</strong></p> - <table class="contentstable" align="center"><tr> - <td width="50%"> - <p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}?</a><br/> - <span class="linkdescr">or <a href="{{ pathto("whatsnew/index") }}">all "What's new" documents</a> since 2.0</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">Tutorial</a><br/> - <span class="linkdescr">start here</span></p> -- <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Using Python</a><br/> -- <span class="linkdescr">how to use Python on different platforms</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">Library Reference</a><br/> - <span class="linkdescr">keep this under your pillow</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/> - <span class="linkdescr">describes syntax and language elements</span></p> -+ <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/> -+ <span class="linkdescr">how to use Python on different platforms</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/> - <span class="linkdescr">in-depth documents on specific topics</span></p> - </td><td width="50%"> - <p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">Extending and Embedding</a><br/> - <span class="linkdescr">tutorial for C/C++ programmers</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">Python/C API</a><br/> - <span class="linkdescr">reference for C/C++ programmers</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("install/index") }}">Installing Python Modules</a><br/> - <span class="linkdescr">information for installers & sys-admins</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("distutils/index") }}">Distributing Python Modules</a><br/> - <span class="linkdescr">sharing modules with others</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("documenting/index") }}">Documenting Python</a><br/> ======================================= --- /tools/sphinxext/indexcontent.html.diff.html Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,104 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>tools/sphinxext/indexcontent.html</title> -<style type="text/css"> -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -</style> -</head> -<body> -<div class="highlight"><pre><span class="gu">@@ -1,27 +1,27 @@</span> - {% extends "defindex.html" %} - {% block tables %} - <p><strong>Parts of the documentation:</strong></p> - <table class="contentstable" align="center"><tr> - <td width="50%"> - <p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}?</a><br/> - <span class="linkdescr">or <a href="{{ pathto("whatsnew/index") }}">all "What's new" documents</a> since 2.0</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">Tutorial</a><br/> - <span class="linkdescr">start here</span></p> -<span class="gd">- <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Using Python</a><br/></span> -<span class="gd">- <span class="linkdescr">how to use Python on different platforms</span></p></span> - <p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">Library Reference</a><br/> - <span class="linkdescr">keep this under your pillow</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/> - <span class="linkdescr">describes syntax and language elements</span></p> -<span class="gi">+ <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/></span> -<span class="gi">+ <span class="linkdescr">how to use Python on different platforms</span></p></span> - <p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/> - <span class="linkdescr">in-depth documents on specific topics</span></p> - </td><td width="50%"> - <p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">Extending and Embedding</a><br/> - <span class="linkdescr">tutorial for C/C++ programmers</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">Python/C API</a><br/> - <span class="linkdescr">reference for C/C++ programmers</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("install/index") }}">Installing Python Modules</a><br/> - <span class="linkdescr">information for installers &amp; sys-admins</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("distutils/index") }}">Distributing Python Modules</a><br/> - <span class="linkdescr">sharing modules with others</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("documenting/index") }}">Documenting Python</a><br/> -</pre></div> - -</body> -</html> ======================================= --- /tools/sphinxext/indexcontent.html Sun Oct 16 09:38:18 2011 +++ /tools/sphinxext/indexcontent.html Fri Nov 11 09:41:02 2011 @@ -16,18 +16,18 @@ <p><strong>ドキュメントの一覧</strong></p> <table class="contentstable" align="center"><tr> <td width="50%"> - <p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}? </a>(英語)<br/> + <p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}? </a>(翻訳中)<br/> {# What's new は古いのは翻訳しないでいいかな? <span class="linkdescr">2.0からの<a href="{{ pathto("whatsnew/index") }}">全ての "What's new" ドキュメント</a>(構築中 )</span></p> #} <p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">チュートリアル</a><br/> <span class="linkdescr">ここから始めましょう</span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python を使う</a><br/> - <span class="linkdescr">各プラットフォームでのPythonの使い方 </span></p> - <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">言語リファレンス</a><br/> - <span class="linkdescr">構文と言語要素の解説</span></p> <p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">ライブラリリファレンス</a><br/> <span class="linkdescr">枕の下に置いておきましょう</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">言語リファレンス</a><br/> + <span class="linkdescr">構文と言語要素の解説</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python のセットアップと利用法</a><br/> + <span class="linkdescr">各プラットフォームでのPythonの使い方 </span></p> <p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTO</a>(翻訳中)<br/> <span class="linkdescr">特定のトピックに関する、より深いドキュ メント</span></p> </td><td width="50%"> ============================================================================== Revision: c687e862a292 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:46:18 2011 Log: Update sphinxext http://code.google.com/p/python-doc-ja/source/detail?r=c687e862a292 Deleted: /tools/sphinxext/patchlevel.py.diff /tools/sphinxext/patchlevel.py.diff.html /tools/sphinxext/pyspecific.py.diff /tools/sphinxext/pyspecific.py.diff.html /tools/sphinxext/susp-ignored.csv.diff /tools/sphinxext/susp-ignored.csv.diff.html /tools/sphinxext/suspicious.py.diff /tools/sphinxext/suspicious.py.diff.html Modified: /tools/sphinxext/patchlevel.py /tools/sphinxext/pyspecific.py /tools/sphinxext/susp-ignored.csv /tools/sphinxext/suspicious.py ======================================= --- /tools/sphinxext/patchlevel.py.diff Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,27 +0,0 @@ -@@ -32,25 +32,25 @@ - finally: - f.close() - - release = version = '%s.%s' % (d['PY_MAJOR_VERSION'], d['PY_MINOR_VERSION']) - micro = int(d['PY_MICRO_VERSION']) - if micro != 0: - release += '.' + str(micro) - - level = d['PY_RELEASE_LEVEL'] - suffixes = { - 'PY_RELEASE_LEVEL_ALPHA': 'a', - 'PY_RELEASE_LEVEL_BETA': 'b', -- 'PY_RELEASE_LEVEL_GAMMA': 'c', -+ 'PY_RELEASE_LEVEL_GAMMA': 'rc', - } - if level != 'PY_RELEASE_LEVEL_FINAL': - release += suffixes[level] + str(int(d['PY_RELEASE_SERIAL'])) - return version, release - - - def get_sys_version_info(): - major, minor, micro, level, serial = sys.version_info - release = version = '%s.%s' % (major, minor) - if micro: - release += '.%s' % micro - if level != 'final': ======================================= --- /tools/sphinxext/patchlevel.py.diff.html Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,101 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>tools/sphinxext/patchlevel.py</title> -<style type="text/css"> -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -</style> -</head> -<body> -<div class="highlight"><pre><span class="gu">@@ -32,25 +32,25 @@</span> - finally: - f.close() - - release = version = '%s.%s' % (d['PY_MAJOR_VERSION'], d['PY_MINOR_VERSION']) - micro = int(d['PY_MICRO_VERSION']) - if micro != 0: - release += '.' + str(micro) - - level = d['PY_RELEASE_LEVEL'] - suffixes = { - 'PY_RELEASE_LEVEL_ALPHA': 'a', - 'PY_RELEASE_LEVEL_BETA': 'b', -<span class="gd">- 'PY_RELEASE_LEVEL_GAMMA': 'c',</span> -<span class="gi">+ 'PY_RELEASE_LEVEL_GAMMA': 'rc',</span> - } - if level != 'PY_RELEASE_LEVEL_FINAL': - release += suffixes[level] + str(int(d['PY_RELEASE_SERIAL'])) - return version, release - - - def get_sys_version_info(): - major, minor, micro, level, serial = sys.version_info - release = version = '%s.%s' % (major, minor) - if micro: - release += '.%s' % micro - if level != 'final': -</pre></div> - -</body> -</html> ======================================= --- /tools/sphinxext/pyspecific.py.diff Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,100 +0,0 @@ -@@ -25,24 +25,25 @@ - self.body.append(self.starttag(node, 'p', CLASS=node['type'])) - text = versionlabels[node['type']] % node['version'] - if len(node): - text += ': ' - else: - text += '.' - self.body.append('<span class="versionmodified">%s</span>' % text) - - from sphinx.writers.html import HTMLTranslator - from sphinx.locale import versionlabels - HTMLTranslator.visit_versionmodified = new_visit_versionmodified - -+ - # Support for marking up and linking to bugs.python.org issues - - def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): - issue = utils.unescape(text) - text = 'issue ' + issue - refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) - return [refnode], [] - - - # Support for marking up implementation details - - from sphinx.util.compat import Directive -@@ -90,67 +91,58 @@ - 'string-conversions', 'string-methods', 'strings', 'subscriptions', 'truth', - 'try', 'types', 'typesfunctions', 'typesmapping', 'typesmethods', - 'typesmodules', 'typesseq', 'typesseq-mutable', 'unary', 'while', 'with', - 'yield' - ] - - from os import path - from time import asctime - from pprint import pformat - from docutils.io import StringOutput - from docutils.utils import new_document - --try: -- from sphinx.builders import Builder --except ImportError: -- # using Sphinx < 0.6, which has a different package layout -- from sphinx.builder import Builder -- # monkey-patch toctree directive to accept (and ignore) the :numbered: flag -- from sphinx.directives.other import toctree_directive -- toctree_directive.options['numbered'] = toctree_directive.options['glob'] -- --try: -- from sphinx.writers.text import TextWriter --except ImportError: -- from sphinx.textwriter import TextWriter -+from sphinx.builders import Builder -+from sphinx.writers.text import TextWriter - - - class PydocTopicsBuilder(Builder): - name = 'pydoc-topics' - - def init(self): - self.topics = {} - - def get_outdated_docs(self): - return 'all pydoc topics' - - def get_target_uri(self, docname, typ=None): - return '' # no URIs - - def write(self, *ignored): - writer = TextWriter(self) -- for label in self.status_iterator(pydoc_topic_labels, 'building topics... '): -+ for label in self.status_iterator(pydoc_topic_labels, -+ 'building topics... ', -+ length=len(pydoc_topic_labels)): - if label not in self.env.labels: - self.warn('label %r not in documentation' % label) - continue - docname, labelid, sectname = self.env.labels[label] - doctree = self.env.get_and_resolve_doctree(docname, self) - document = new_document('<section node>') - document.append(doctree.ids[labelid]) - destination = StringOutput(encoding='utf-8') - writer.write(document, destination) - self.topics[label] = writer.output - - def finish(self): -- f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w') -+ f = open(path.join(self.outdir, 'topics.py'), 'w') - try: - f.write('# Autogenerated by Sphinx on %s\n' % asctime()) - f.write('topics = ' + pformat(self.topics) + '\n') - finally: - f.close() - - - # Support for checking for suspicious markup - - import suspicious - - ======================================= --- /tools/sphinxext/pyspecific.py.diff.html Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,174 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>tools/sphinxext/pyspecific.py</title> -<style type="text/css"> -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -</style> -</head> -<body> -<div class="highlight"><pre><span class="gu">@@ -25,24 +25,25 @@</span> - self.body.append(self.starttag(node, 'p', CLASS=node['type'])) - text = versionlabels[node['type']] % node['version'] - if len(node): - text += ': ' - else: - text += '.' - self.body.append('<span class="versionmodified">%s</span>' % text) - - from sphinx.writers.html import HTMLTranslator - from sphinx.locale import versionlabels - HTMLTranslator.visit_versionmodified = new_visit_versionmodified - -<span class="gi">+</span> - # Support for marking up and linking to bugs.python.org issues - - def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): - issue = utils.unescape(text) - text = 'issue ' + issue - refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) - return [refnode], [] - - - # Support for marking up implementation details - - from sphinx.util.compat import Directive -<span class="gu">@@ -90,67 +91,58 @@</span> - 'string-conversions', 'string-methods', 'strings', 'subscriptions', 'truth', - 'try', 'types', 'typesfunctions', 'typesmapping', 'typesmethods', - 'typesmodules', 'typesseq', 'typesseq-mutable', 'unary', 'while', 'with', - 'yield' - ] - - from os import path - from time import asctime - from pprint import pformat - from docutils.io import StringOutput - from docutils.utils import new_document - -<span class="gd">-try:</span> -<span class="gd">- from sphinx.builders import Builder</span> -<span class="gd">-except ImportError:</span> -<span class="gd">- # using Sphinx < 0.6, which has a different package layout</span> -<span class="gd">- from sphinx.builder import Builder</span> -<span class="gd">- # monkey-patch toctree directive to accept (and ignore) the :numbered: flag</span> -<span class="gd">- from sphinx.directives.other import toctree_directive</span> -<span class="gd">- toctree_directive.options['numbered'] = toctree_directive.options['glob']</span> -<span class="gd">-</span> -<span class="gd">-try:</span> -<span class="gd">- from sphinx.writers.text import TextWriter</span> -<span class="gd">-except ImportError:</span> -<span class="gd">- from sphinx.textwriter import TextWriter</span> -<span class="gi">+from sphinx.builders import Builder</span> -<span class="gi">+from sphinx.writers.text import TextWriter</span> - - - class PydocTopicsBuilder(Builder): - name = 'pydoc-topics' - - def init(self): - self.topics = {} - - def get_outdated_docs(self): - return 'all pydoc topics' - - def get_target_uri(self, docname, typ=None): - return '' # no URIs - - def write(self, *ignored): - writer = TextWriter(self) -<span class="gd">- for label in self.status_iterator(pydoc_topic_labels, 'building topics... '):</span> -<span class="gi">+ for label in self.status_iterator(pydoc_topic_labels,</span> -<span class="gi">+ 'building topics... ',</span> -<span class="gi">+ length=len(pydoc_topic_labels)):</span> - if label not in self.env.labels: - self.warn('label %r not in documentation' % label) - continue - docname, labelid, sectname = self.env.labels[label] - doctree = self.env.get_and_resolve_doctree(docname, self) - document = new_document('<section node>') - document.append(doctree.ids[labelid]) - destination = StringOutput(encoding='utf-8') - writer.write(document, destination) - self.topics[label] = writer.output - - def finish(self): -<span class="gd">- f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w')</span> -<span class="gi">+ f = open(path.join(self.outdir, 'topics.py'), 'w')</span> - try: - f.write('# Autogenerated by Sphinx on %s\n' % asctime()) - f.write('topics = ' + pformat(self.topics) + '\n') - finally: - f.close() - - - # Support for checking for suspicious markup - - import suspicious - - -</pre></div> - -</body> -</html> ======================================= --- /tools/sphinxext/susp-ignored.csv.diff Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,149 +0,0 @@ -@@ -155,12 +155,148 @@ - whatsnew/2.3,,::, - whatsnew/2.3,,:config, - whatsnew/2.3,,:Critical, - whatsnew/2.3,,:Error, - whatsnew/2.3,,:Problem, - whatsnew/2.3,,:root, - whatsnew/2.3,,:Warning, - whatsnew/2.4,,::, - whatsnew/2.4,,:System, - whatsnew/2.5,,:memory,:memory: - whatsnew/2.5,,:step,[start:stop:step] - whatsnew/2.5,,:stop,[start:stop:step] -+distutils/examples,267,`,This is the description of the ``foobar`` package. -+documenting/fromlatex,39,:func,:func:`str(object)` -+documenting/fromlatex,39,`,:func:`str(object)` -+documenting/fromlatex,39,`,``str(object)`` -+documenting/fromlatex,55,.. deprecated:,.. deprecated:: 2.5 -+documenting/fromlatex,66,.. note:,.. note:: -+documenting/fromlatex,76,:samp,":samp:`open({filename}, {mode})`" -+documenting/fromlatex,76,`,":samp:`open({filename}, {mode})`" -+documenting/fromlatex,80,`,``'c'`` -+documenting/fromlatex,80,`,`Title <URL>`_ -+documenting/fromlatex,80,`,``code`` -+documenting/fromlatex,80,`,`Title <URL>`_ -+documenting/fromlatex,99,:file,:file:`C:\\Temp\\my.tmp` -+documenting/fromlatex,99,`,:file:`C:\\Temp\\my.tmp` -+documenting/fromlatex,99,`,"``open(""C:\Temp\my.tmp"")``" -+documenting/fromlatex,129,.. function:,.. function:: do_foo(bar) -+documenting/fromlatex,141,.. function:,".. function:: open(filename[, mode[, buffering]])" -+documenting/fromlatex,152,.. function:,.. function:: foo_* -+documenting/fromlatex,152,:noindex,:noindex: -+documenting/fromlatex,162,.. describe:,.. describe:: a == b -+documenting/fromlatex,168,.. cmdoption:,.. cmdoption:: -O -+documenting/fromlatex,168,.. envvar:,.. envvar:: PYTHONINSPECT -+documenting/rest,33,`,``text`` -+documenting/rest,47,:rolename,:rolename:`content` -+documenting/rest,47,`,:rolename:`content` -+documenting/rest,103,::,This is a normal text paragraph. The next paragraph is a code sample:: -+documenting/rest,130,`,`Link text <http://target>`_ -+documenting/rest,187,.. function:,.. function:: foo(x) -+documenting/rest,187,:bar,:bar: no -+documenting/rest,208,.. rubric:,.. rubric:: Footnotes -+faq/programming,,:reduce,"print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y," -+faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro," -+faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(" -+faq/programming,,::,for x in sequence[::-1]: -+faq/windows,229,:EOF, @ setlocal enableextensions & python -x %~f0 %* & goto :EOF -+faq/windows,393,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s -+library/bisect,,:hi,all(val >= x for val in a[i:hi]) -+library/bisect,,:hi,all(val > x for val in a[i:hi]) -+library/http.client,52,:port,host:port -+library/nntplib,,:bytes,:bytes -+library/nntplib,,:lines,:lines -+library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" -+library/nntplib,,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" -+library/pickle,567,:memory,"conn = sqlite3.connect("":memory:"")" -+library/profile,293,:lineno,"(sort by filename:lineno)," -+library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]" -+library/stdtypes,,:end,s[start:end] -+library/stdtypes,,:end,s[start:end] -+license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -+license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -+license,,`,"``Software''), to deal in the Software without restriction, including" -+license,,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND," -+reference/lexical_analysis,704,`,$ ? ` -+whatsnew/2.7,735,:Sunday,'2009:4:Sunday' -+whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0" -+whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0" -+whatsnew/2.7,,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo') -+whatsnew/2.7,,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]'," -+documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum <guido****@pytho*****> -+documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access -+documenting/markup,42,`,:mod:`parrot` -- Dead parrot access -+documenting/markup,42,.. module:,.. module:: parrot -+documenting/markup,42,:platform,":platform: Unix, Windows" -+documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots. -+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese <eric****@pytho*****> -+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle <john****@pytho*****> -+documenting/markup,88,:noindex,:noindex: -+documenting/markup,95,.. function:,.. function:: spam(eggs) -+documenting/markup,95,:noindex,:noindex: -+documenting/markup,101,.. method:,.. method:: FileInput.input(...) -+documenting/markup,121,.. cfunction:,".. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)" -+documenting/markup,131,.. cmember:,.. cmember:: PyObject* PyTypeObject.tp_bases -+documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type -+documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])" -+documenting/markup,209,.. cmdoption:,.. cmdoption:: -m <module> -+documenting/markup,227,.. describe:,.. describe:: opcode -+documenting/markup,256,.. highlightlang:,.. highlightlang:: c -+documenting/markup,276,.. literalinclude:,.. literalinclude:: example.py -+documenting/markup,291,:rolename,:rolename:`content` -+documenting/markup,291,`,:rolename:`content` -+documenting/markup,296,:role,:role:`title <target>` -+documenting/markup,296,`,:role:`title <target>` -+documenting/markup,302,:meth,:meth:`~Queue.Queue.get` -+documenting/markup,302,`,:meth:`~Queue.Queue.get` -+documenting/markup,350,:func,:func:`filter` -+documenting/markup,350,`,:func:`filter` -+documenting/markup,350,:func,:func:`foo.filter` -+documenting/markup,350,`,:func:`foo.filter` -+documenting/markup,356,:func,:func:`open` -+documenting/markup,356,`,:func:`open` -+documenting/markup,356,:func,:func:`.open` -+documenting/markup,356,`,:func:`.open` -+documenting/markup,435,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... -+documenting/markup,435,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... -+documenting/markup,454,:kbd,:kbd:`C-x C-f` -+documenting/markup,454,`,:kbd:`C-x C-f` -+documenting/markup,454,:kbd,:kbd:`Control-x Control-f` -+documenting/markup,454,`,:kbd:`Control-x Control-f` -+documenting/markup,468,:mailheader,:mailheader:`Content-Type` -+documenting/markup,468,`,:mailheader:`Content-Type` -+documenting/markup,477,:manpage,:manpage:`ls(1)` -+documenting/markup,477,`,:manpage:`ls(1)` -+documenting/markup,493,:menuselection,:menuselection:`Start --> Programs` -+documenting/markup,493,`,:menuselection:`Start --> Programs` -+documenting/markup,508,`,``code`` -+documenting/markup,526,:file,:file: -+documenting/markup,526,`,``code`` -+documenting/markup,561,:ref,:ref:`label-name` -+documenting/markup,561,`,:ref:`label-name` -+documenting/markup,565,:ref,"It refers to the section itself, see :ref:`my-reference-label`." -+documenting/markup,565,`,"It refers to the section itself, see :ref:`my-reference-label`." -+documenting/markup,574,:ref,:ref: -+documenting/markup,595,.. note:,.. note:: -+documenting/markup,622,.. versionadded:,.. versionadded:: 2.5 -+documenting/markup,647,::,.. impl-detail:: -+documenting/markup,647,::,.. impl-detail:: This shortly mentions an implementation detail. -+documenting/markup,667,.. seealso:,.. seealso:: -+documenting/markup,667,:mod,Module :mod:`zipfile` -+documenting/markup,667,`,Module :mod:`zipfile` -+documenting/markup,667,:mod,Documentation of the :mod:`zipfile` standard module. -+documenting/markup,667,`,Documentation of the :mod:`zipfile` standard module. -+documenting/markup,667,`,"`GNU tar manual, Basic Tar Format <http://link>`_" -+documenting/markup,681,.. centered:,.. centered:: -+documenting/markup,726,.. toctree:,.. toctree:: -+documenting/markup,726,:maxdepth,:maxdepth: 2 -+documenting/markup,742,.. index:,.. index:: -+documenting/markup,772,.. index:,".. index:: BNF, grammar, syntax, notation" -+documenting/markup,803,`,"unaryneg ::= ""-"" `integer`" -+documenting/markup,808,.. productionlist:,.. productionlist:: -+documenting/markup,808,`,"try1_stmt: ""try"" "":"" `suite`" -+documenting/markup,808,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+" -+documenting/markup,808,`,": [""else"" "":"" `suite`]" -+documenting/markup,808,`,": [""finally"" "":"" `suite`]" -+documenting/markup,808,`,"try2_stmt: ""try"" "":"" `suite`" -+documenting/markup,808,`,": ""finally"" "":"" `suite`" -+library/urllib2,67,:close,Connection:close ======================================= --- /tools/sphinxext/susp-ignored.csv.diff.html Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,223 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>tools/sphinxext/susp-ignored.csv</title> -<style type="text/css"> -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -</style> -</head> -<body> -<div class="highlight"><pre><span class="gu">@@ -155,12 +155,148 @@</span> - whatsnew/2.3,,::, - whatsnew/2.3,,:config, - whatsnew/2.3,,:Critical, - whatsnew/2.3,,:Error, - whatsnew/2.3,,:Problem, - whatsnew/2.3,,:root, - whatsnew/2.3,,:Warning, - whatsnew/2.4,,::, - whatsnew/2.4,,:System, - whatsnew/2.5,,:memory,:memory: - whatsnew/2.5,,:step,[start:stop:step] - whatsnew/2.5,,:stop,[start:stop:step] -<span class="gi">+distutils/examples,267,`,This is the description of the ``foobar`` package.</span> -<span class="gi">+documenting/fromlatex,39,:func,:func:`str(object)`</span> -<span class="gi">+documenting/fromlatex,39,`,:func:`str(object)`</span> -<span class="gi">+documenting/fromlatex,39,`,``str(object)``</span> -<span class="gi">+documenting/fromlatex,55,.. deprecated:,.. deprecated:: 2.5</span> -<span class="gi">+documenting/fromlatex,66,.. note:,.. note::</span> -<span class="gi">+documenting/fromlatex,76,:samp,":samp:`open({filename}, {mode})`"</span> -<span class="gi">+documenting/fromlatex,76,`,":samp:`open({filename}, {mode})`"</span> -<span class="gi">+documenting/fromlatex,80,`,``'c'``</span> -<span class="gi">+documenting/fromlatex,80,`,`Title <URL>`_</span> -<span class="gi">+documenting/fromlatex,80,`,``code``</span> -<span class="gi">+documenting/fromlatex,80,`,`Title <URL>`_</span> -<span class="gi">+documenting/fromlatex,99,:file,:file:`C:\\Temp\\my.tmp`</span> -<span class="gi">+documenting/fromlatex,99,`,:file:`C:\\Temp\\my.tmp`</span> -<span class="gi">+documenting/fromlatex,99,`,"``open(""C:\Temp\my.tmp"")``"</span> -<span class="gi">+documenting/fromlatex,129,.. function:,.. function:: do_foo(bar)</span> -<span class="gi">+documenting/fromlatex,141,.. function:,".. function:: open(filename[, mode[, buffering]])"</span> -<span class="gi">+documenting/fromlatex,152,.. function:,.. function:: foo_*</span> -<span class="gi">+documenting/fromlatex,152,:noindex,:noindex:</span> -<span class="gi">+documenting/fromlatex,162,.. describe:,.. describe:: a == b</span> -<span class="gi">+documenting/fromlatex,168,.. cmdoption:,.. cmdoption:: -O</span> -<span class="gi">+documenting/fromlatex,168,.. envvar:,.. envvar:: PYTHONINSPECT</span> -<span class="gi">+documenting/rest,33,`,``text``</span> -<span class="gi">+documenting/rest,47,:rolename,:rolename:`content`</span> -<span class="gi">+documenting/rest,47,`,:rolename:`content`</span> -<span class="gi">+documenting/rest,103,::,This is a normal text paragraph. The next paragraph is a code sample::</span> -<span class="gi">+documenting/rest,130,`,`Link text <http://target>`_</span> -<span class="gi">+documenting/rest,187,.. function:,.. function:: foo(x)</span> -<span class="gi">+documenting/rest,187,:bar,:bar: no</span> -<span class="gi">+documenting/rest,208,.. rubric:,.. rubric:: Footnotes</span> -<span class="gi">+faq/programming,,:reduce,"print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,"</span> -<span class="gi">+faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,"</span> -<span class="gi">+faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr("</span> -<span class="gi">+faq/programming,,::,for x in sequence[::-1]:</span> -<span class="gi">+faq/windows,229,:EOF, @ setlocal enableextensions & python -x %~f0 %* & goto :EOF</span> -<span class="gi">+faq/windows,393,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s</span> -<span class="gi">+library/bisect,,:hi,all(val >= x for val in a[i:hi])</span> -<span class="gi">+library/bisect,,:hi,all(val > x for val in a[i:hi])</span> -<span class="gi">+library/http.client,52,:port,host:port</span> -<span class="gi">+library/nntplib,,:bytes,:bytes</span> -<span class="gi">+library/nntplib,,:lines,:lines</span> -<span class="gi">+library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"</span> -<span class="gi">+library/nntplib,,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"</span> -<span class="gi">+library/pickle,567,:memory,"conn = sqlite3.connect("":memory:"")"</span> -<span class="gi">+library/profile,293,:lineno,"(sort by filename:lineno),"</span> -<span class="gi">+library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]"</span> -<span class="gi">+library/stdtypes,,:end,s[start:end]</span> -<span class="gi">+library/stdtypes,,:end,s[start:end]</span> -<span class="gi">+license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY</span> -<span class="gi">+license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND</span> -<span class="gi">+license,,`,"``Software''), to deal in the Software without restriction, including"</span> -<span class="gi">+license,,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,"</span> -<span class="gi">+reference/lexical_analysis,704,`,$ ? `</span> -<span class="gi">+whatsnew/2.7,735,:Sunday,'2009:4:Sunday'</span> -<span class="gi">+whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0"</span> -<span class="gi">+whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"</span> -<span class="gi">+whatsnew/2.7,,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo')</span> -<span class="gi">+whatsnew/2.7,,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]',"</span> -<span class="gi">+documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum <guido****@pytho*****></span> -<span class="gi">+documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access</span> -<span class="gi">+documenting/markup,42,`,:mod:`parrot` -- Dead parrot access</span> -<span class="gi">+documenting/markup,42,.. module:,.. module:: parrot</span> -<span class="gi">+documenting/markup,42,:platform,":platform: Unix, Windows"</span> -<span class="gi">+documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots.</span> -<span class="gi">+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese <eric****@pytho*****></span> -<span class="gi">+documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle <john****@pytho*****></span> -<span class="gi">+documenting/markup,88,:noindex,:noindex:</span> -<span class="gi">+documenting/markup,95,.. function:,.. function:: spam(eggs)</span> -<span class="gi">+documenting/markup,95,:noindex,:noindex:</span> -<span class="gi">+documenting/markup,101,.. method:,.. method:: FileInput.input(...)</span> -<span class="gi">+documenting/markup,121,.. cfunction:,".. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)"</span> -<span class="gi">+documenting/markup,131,.. cmember:,.. cmember:: PyObject* PyTypeObject.tp_bases</span> -<span class="gi">+documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type</span> -<span class="gi">+documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])"</span> -<span class="gi">+documenting/markup,209,.. cmdoption:,.. cmdoption:: -m <module></span> -<span class="gi">+documenting/markup,227,.. describe:,.. describe:: opcode</span> -<span class="gi">+documenting/markup,256,.. highlightlang:,.. highlightlang:: c</span> -<span class="gi">+documenting/markup,276,.. literalinclude:,.. literalinclude:: example.py</span> -<span class="gi">+documenting/markup,291,:rolename,:rolename:`content`</span> -<span class="gi">+documenting/markup,291,`,:rolename:`content`</span> -<span class="gi">+documenting/markup,296,:role,:role:`title <target>`</span> -<span class="gi">+documenting/markup,296,`,:role:`title <target>`</span> -<span class="gi">+documenting/markup,302,:meth,:meth:`~Queue.Queue.get`</span> -<span class="gi">+documenting/markup,302,`,:meth:`~Queue.Queue.get`</span> -<span class="gi">+documenting/markup,350,:func,:func:`filter`</span> -<span class="gi">+documenting/markup,350,`,:func:`filter`</span> -<span class="gi">+documenting/markup,350,:func,:func:`foo.filter`</span> -<span class="gi">+documenting/markup,350,`,:func:`foo.filter`</span> -<span class="gi">+documenting/markup,356,:func,:func:`open`</span> -<span class="gi">+documenting/markup,356,`,:func:`open`</span> -<span class="gi">+documenting/markup,356,:func,:func:`.open`</span> -<span class="gi">+documenting/markup,356,`,:func:`.open`</span> -<span class="gi">+documenting/markup,435,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...</span> -<span class="gi">+documenting/markup,435,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ...</span> -<span class="gi">+documenting/markup,454,:kbd,:kbd:`C-x C-f`</span> -<span class="gi">+documenting/markup,454,`,:kbd:`C-x C-f`</span> -<span class="gi">+documenting/markup,454,:kbd,:kbd:`Control-x Control-f`</span> -<span class="gi">+documenting/markup,454,`,:kbd:`Control-x Control-f`</span> -<span class="gi">+documenting/markup,468,:mailheader,:mailheader:`Content-Type`</span> -<span class="gi">+documenting/markup,468,`,:mailheader:`Content-Type`</span> -<span class="gi">+documenting/markup,477,:manpage,:manpage:`ls(1)`</span> -<span class="gi">+documenting/markup,477,`,:manpage:`ls(1)`</span> -<span class="gi">+documenting/markup,493,:menuselection,:menuselection:`Start --> Programs`</span> -<span class="gi">+documenting/markup,493,`,:menuselection:`Start --> Programs`</span> -<span class="gi">+documenting/markup,508,`,``code``</span> -<span class="gi">+documenting/markup,526,:file,:file:</span> -<span class="gi">+documenting/markup,526,`,``code``</span> -<span class="gi">+documenting/markup,561,:ref,:ref:`label-name`</span> -<span class="gi">+documenting/markup,561,`,:ref:`label-name`</span> -<span class="gi">+documenting/markup,565,:ref,"It refers to the section itself, see :ref:`my-reference-label`."</span> -<span class="gi">+documenting/markup,565,`,"It refers to the section itself, see :ref:`my-reference-label`."</span> -<span class="gi">+documenting/markup,574,:ref,:ref:</span> -<span class="gi">+documenting/markup,595,.. note:,.. note::</span> -<span class="gi">+documenting/markup,622,.. versionadded:,.. versionadded:: 2.5</span> -<span class="gi">+documenting/markup,647,::,.. impl-detail::</span> -<span class="gi">+documenting/markup,647,::,.. impl-detail:: This shortly mentions an implementation detail.</span> -<span class="gi">+documenting/markup,667,.. seealso:,.. seealso::</span> -<span class="gi">+documenting/markup,667,:mod,Module :mod:`zipfile`</span> -<span class="gi">+documenting/markup,667,`,Module :mod:`zipfile`</span> -<span class="gi">+documenting/markup,667,:mod,Documentation of the :mod:`zipfile` standard module.</span> -<span class="gi">+documenting/markup,667,`,Documentation of the :mod:`zipfile` standard module.</span> -<span class="gi">+documenting/markup,667,`,"`GNU tar manual, Basic Tar Format <http://link>`_"</span> -<span class="gi">+documenting/markup,681,.. centered:,.. centered::</span> -<span class="gi">+documenting/markup,726,.. toctree:,.. toctree::</span> -<span class="gi">+documenting/markup,726,:maxdepth,:maxdepth: 2</span> -<span class="gi">+documenting/markup,742,.. index:,.. index::</span> -<span class="gi">+documenting/markup,772,.. index:,".. index:: BNF, grammar, syntax, notation"</span> -<span class="gi">+documenting/markup,803,`,"unaryneg ::= ""-"" `integer`"</span> -<span class="gi">+documenting/markup,808,.. productionlist:,.. productionlist::</span> -<span class="gi">+documenting/markup,808,`,"try1_stmt: ""try"" "":"" `suite`"</span> -<span class="gi">+documenting/markup,808,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+"</span> -<span class="gi">+documenting/markup,808,`,": [""else"" "":"" `suite`]"</span> -<span class="gi">+documenting/markup,808,`,": [""finally"" "":"" `suite`]"</span> -<span class="gi">+documenting/markup,808,`,"try2_stmt: ""try"" "":"" `suite`"</span> -<span class="gi">+documenting/markup,808,`,": ""finally"" "":"" `suite`"</span> -<span class="gi">+library/urllib2,67,:close,Connection:close</span> -</pre></div> - -</body> -</html> ======================================= --- /tools/sphinxext/suspicious.py.diff Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,229 +0,0 @@ -@@ -32,95 +32,96 @@ - * problematic texts are the same - * line numbers are close to each other (5 lines up or down) - * the rule text is completely contained into the source line - - The simplest way to create the ignored.csv file is by copying - undesired entries from suspicious.csv (possibly trimming the last - field.) - - Copyright 2009 Gabriel A. Genellina - - """ - --import os, sys -+import os -+import re - import csv --import re -+import sys -+ - from docutils import nodes -- --try: -- from sphinx.builders import Builder --except ImportError: -- from sphinx.builder import Builder -- -+from sphinx.builders import Builder - - detect_all = re.compile(ur''' - ::(?=[^=])| # two :: (but NOT ::=) - :[a-zA-Z][a-zA-Z0-9]+| # :foo - `| # ` (seldom used by itself) - (?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT ... else:) - ''', re.UNICODE | re.VERBOSE).finditer - -+ - class Rule: - def __init__(self, docname, lineno, issue, line): -- "A rule for ignoring issues" -+ """A rule for ignoring issues""" - self.docname = docname # document to which this rule applies - self.lineno = lineno # line number in the original source; - # this rule matches only near that. - # None -> don't care - self.issue = issue # the markup fragment that triggered this rule - self.line = line # text of the container element (single line only) - - -+ -+class dialect(csv.excel): -+ """Our dialect: uses only linefeed as newline.""" -+ lineterminator = '\n' -+ -+ - class CheckSuspiciousMarkupBuilder(Builder): - """ -- Checks for possibly invalid markup that may leak into the output -+ Checks for possibly invalid markup that may leak into the output. - """ - name = 'suspicious' - - def init(self): - # create output file - self.log_file_name = os.path.join(self.outdir, 'suspicious.csv') - open(self.log_file_name, 'w').close() - # load database of previously ignored issues -- self.load_rules(os.path.join(os.path.dirname(__file__), 'susp-ignored.csv')) -+ self.load_rules(os.path.join(os.path.dirname(__file__), -+ 'susp-ignored.csv')) - - def get_outdated_docs(self): - return self.env.found_docs - - def get_target_uri(self, docname, typ=None): - return '' - - def prepare_writing(self, docnames): -- ### PYTHON PROJECT SPECIFIC ### -- for name in set(docnames): -- if name.split('/', 1)[0] == 'documenting': -- docnames.remove(name) -- ### PYTHON PROJECT SPECIFIC ### -+ pass - - def write_doc(self, docname, doctree): -- self.any_issue = False # set when any issue is encountered in this document -+ # set when any issue is encountered in this document -+ self.any_issue = False - self.docname = docname - visitor = SuspiciousVisitor(doctree, self) - doctree.walk(visitor) - - def finish(self): - return - - def check_issue(self, line, lineno, issue): - if not self.is_ignored(line, lineno, issue): - self.report_issue(line, lineno, issue) - - def is_ignored(self, line, lineno, issue): -- """Determine whether this issue should be ignored. -- """ -+ """Determine whether this issue should be ignored.""" - docname = self.docname - for rule in self.rules: - if rule.docname != docname: continue - if rule.issue != issue: continue - # Both lines must match *exactly*. This is rather strict, - # and probably should be improved. - # Doing fuzzy matches with levenshtein distance could work, - # but that means bringing other libraries... - # Ok, relax that requirement: just check if the rule fragment - # is contained in the document line - if rule.line not in line: continue - # Check both line numbers. If they're "near" -@@ -135,103 +136,103 @@ - if not self.any_issue: self.info() - self.any_issue = True - self.write_log_entry(lineno, issue, text) - self.warn('[%s:%d] "%s" found in "%-.120s"' % ( - self.docname.encode(sys.getdefaultencoding(),'replace'), - lineno, - issue.encode(sys.getdefaultencoding(),'replace'), - text.strip().encode(sys.getdefaultencoding(),'replace'))) - self.app.statuscode = 1 - - def write_log_entry(self, lineno, issue, text): - f = open(self.log_file_name, 'ab') -- writer = csv.writer(f) -+ writer = csv.writer(f, dialect) - writer.writerow([self.docname.encode('utf-8'), -- lineno, -- issue.encode('utf-8'), -- text.strip().encode('utf-8')]) -- del writer -+ lineno, -+ issue.encode('utf-8'), -+ text.strip().encode('utf-8')]) - f.close() - - def load_rules(self, filename): - """Load database of previously ignored issues. - - A csv file, with exactly the same format as suspicious.csv - Fields: document name (normalized), line number, issue, surrounding text - """ - self.info("loading ignore rules... ", nonl=1) - self.rules = rules = [] - try: f = open(filename, 'rb') - except IOError: return - for i, row in enumerate(csv.reader(f)): - if len(row) != 4: -- raise ValueError("wrong format in %s, line %d: %s" % (filename, i+1, row)) -+ raise ValueError( -+ "wrong format in %s, line %d: %s" % (filename, i+1, row)) - docname, lineno, issue, text = row - docname = docname.decode('utf-8') - if lineno: lineno = int(lineno) - else: lineno = None - issue = issue.decode('utf-8') - text = text.decode('utf-8') - rule = Rule(docname, lineno, issue, text) - rules.append(rule) - f.close() - self.info('done, %d rules loaded' % len(self.rules)) - - - def get_lineno(node): -- "Obtain line number information for a node" -+ """Obtain line number information for a node.""" - lineno = None - while lineno is None and node: - node = node.parent - lineno = node.line - return lineno - - - def extract_line(text, index): - """text may be a multiline string; extract - only the line containing the given character index. - - >>> extract_line("abc\ndefgh\ni", 6) - >>> 'defgh' - >>> for i in (0, 2, 3, 4, 10): - ... print extract_line("abc\ndefgh\ni", i) - abc - abc - abc - defgh - defgh - i - """ - p = text.rfind('\n', 0, index) + 1 - q = text.find('\n', index) -- if q<0: q = len(text) -+ if q < 0: -+ q = len(text) - return text[p:q] - - - class SuspiciousVisitor(nodes.GenericNodeVisitor): - - lastlineno = 0 - - def __init__(self, document, builder): - nodes.GenericNodeVisitor.__init__(self, document) - self.builder = builder - - def default_visit(self, node): - if isinstance(node, (nodes.Text, nodes.image)): # direct text containers - text = node.astext() - # lineno seems to go backwards sometimes (?) - self.lastlineno = lineno = max(get_lineno(node) or 0, self.lastlineno) - seen = set() # don't report the same issue more than only once per line - for match in detect_all(text): -- #import pdb; pdb.set_trace() - issue = match.group() - line = extract_line(text, match.start()) - if (issue, line) not in seen: - self.builder.check_issue(line, lineno, issue) - seen.add((issue, line)) - - unknown_visit = default_visit - - def visit_document(self, node): - self.lastlineno = 0 - - def visit_comment(self, node): ======================================= --- /tools/sphinxext/suspicious.py.diff.html Sun Oct 30 17:04:23 2011 +++ /dev/null @@ -1,303 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>tools/sphinxext/suspicious.py</title> -<style type="text/css"> -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #808080 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ -</style> -</head> -<body> -<div class="highlight"><pre><span class="gu">@@ -32,95 +32,96 @@</span> - * problematic texts are the same - * line numbers are close to each other (5 lines up or down) - * the rule text is completely contained into the source line - - The simplest way to create the ignored.csv file is by copying - undesired entries from suspicious.csv (possibly trimming the last - field.) - - Copyright 2009 Gabriel A. Genellina - - """ - -<span class="gd">-import os, sys</span> -<span class="gi">+import os</span> -<span class="gi">+import re</span> - import csv -<span class="gd">-import re</span> -<span class="gi">+import sys</span> -<span class="gi">+</span> - from docutils import nodes -<span class="gd">-</span> -<span class="gd">-try:</span> -<span class="gd">- from sphinx.builders import Builder</span> -<span class="gd">-except ImportError:</span> -<span class="gd">- from sphinx.builder import Builder</span> -<span class="gd">-</span> -<span class="gi">+from sphinx.builders import Builder</span> - - detect_all = re.compile(ur''' - ::(?=[^=])| # two :: (but NOT ::=) - :[a-zA-Z][a-zA-Z0-9]+| # :foo - `| # ` (seldom used by itself) - (?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT ... else:) - ''', re.UNICODE | re.VERBOSE).finditer - -<span class="gi">+</span> - class Rule: - def __init__(self, docname, lineno, issue, line): -<span class="gd">- "A rule for ignoring issues"</span> -<span class="gi">+ """A rule for ignoring issues"""</span> - self.docname = docname # document to which this rule applies - self.lineno = lineno # line number in the original source; - # this rule matches only near that. - # None -> don't care - self.issue = issue # the markup fragment that triggered this rule - self.line = line # text of the container element (single line only) - - -<span class="gi">+</span> -<span class="gi">+class dialect(csv.excel):</span> -<span class="gi">+ """Our dialect: uses only linefeed as newline."""</span> -<span class="gi">+ lineterminator = '\n'</span> -<span class="gi">+</span> -<span class="gi">+</span> - class CheckSuspiciousMarkupBuilder(Builder): - """ -<span class="gd">- Checks for possibly invalid markup that may leak into the output</span> -<span class="gi">+ Checks for possibly invalid markup that may leak into the output.</span> - """ - name = 'suspicious' - - def init(self): - # create output file - self.log_file_name = os.path.join(self.outdir, 'suspicious.csv') - open(self.log_file_name, 'w').close() - # load database of previously ignored issues -<span class="gd">- self.load_rules(os.path.join(os.path.dirname(__file__), 'susp-ignored.csv'))</span> -<span class="gi">+ self.load_rules(os.path.join(os.path.dirname(__file__),</span> -<span class="gi">+ 'susp-ignored.csv'))</span> - - def get_outdated_docs(self): - return self.env.found_docs - - def get_target_uri(self, docname, typ=None): - return '' - - def prepare_writing(self, docnames): -<span class="gd">- ### PYTHON PROJECT SPECIFIC ###</span> -<span class="gd">- for name in set(docnames):</span> -<span class="gd">- if name.split('/', 1)[0] == 'documenting':</span> -<span class="gd">- docnames.remove(name)</span> -<span class="gd">- ### PYTHON PROJECT SPECIFIC ###</span> -<span class="gi">+ pass</span> - - def write_doc(self, docname, doctree): -<span class="gd">- self.any_issue = False # set when any issue is encountered in this document</span> -<span class="gi">+ # set when any issue is encountered in this document</span> -<span class="gi">+ self.any_issue = False</span> - self.docname = docname - visitor = SuspiciousVisitor(doctree, self) - doctree.walk(visitor) - - def finish(self): - return - - def check_issue(self, line, lineno, issue): - if not self.is_ignored(line, lineno, issue): - self.report_issue(line, lineno, issue) - - def is_ignored(self, line, lineno, issue): -<span class="gd">- """Determine whether this issue should be ignored.</span> -<span class="gd">- """</span> -<span class="gi">+ """Determine whether this issue should be ignored."""</span> - docname = self.docname - for rule in self.rules: - if rule.docname != docname: continue - if rule.issue != issue: continue - # Both lines must match *exactly*. This is rather strict, - # and probably should be improved. - # Doing fuzzy matches with levenshtein distance could work, - # but that means bringing other libraries... - # Ok, relax that requirement: just check if the rule fragment - # is contained in the document line - if rule.line not in line: continue - # Check both line numbers. If they're "near" -<span class="gu">@@ -135,103 +136,103 @@</span> - if not self.any_issue: self.info() - self.any_issue = True - self.write_log_entry(lineno, issue, text) - self.warn('[%s:%d] "%s" found in "%-.120s"' % ( - self.docname.encode(sys.getdefaultencoding(),'replace'), - lineno, - issue.encode(sys.getdefaultencoding(),'replace'), - text.strip().encode(sys.getdefaultencoding(),'replace'))) - self.app.statuscode = 1 - - def write_log_entry(self, lineno, issue, text): - f = open(self.log_file_name, 'ab') -<span class="gd">- writer = csv.writer(f)</span> -<span class="gi">+ writer = csv.writer(f, dialect)</span> - writer.writerow([self.docname.encode('utf-8'), -<span class="gd">- lineno,</span> -<span class="gd">- issue.encode('utf-8'),</span> -<span class="gd">- text.strip().encode('utf-8')])</span> -<span class="gd">- del writer</span> -<span class="gi">+ lineno,</span> -<span class="gi">+ issue.encode('utf-8'),</span> -<span class="gi">+ text.strip().encode('utf-8')])</span> - f.close() - - def load_rules(self, filename): - """Load database of previously ignored issues. - - A csv file, with exactly the same format as suspicious.csv - Fields: document name (normalized), line number, issue, surrounding text - """ - self.info("loading ignore rules... ", nonl=1) - self.rules = rules = [] - try: f = open(filename, 'rb') - except IOError: return - for i, row in enumerate(csv.reader(f)): - if len(row) != 4: -<span class="gd">- raise ValueError("wrong format in %s, line %d: %s" % (filename, i+1, row))</span> -<span class="gi">+ raise ValueError(</span> -<span class="gi">+ "wrong format in %s, line %d: %s" % (filename, i+1, row))</span> - docname, lineno, issue, text = row - docname = docname.decode('utf-8') - if lineno: lineno = int(lineno) - else: lineno = None - issue = issue.decode('utf-8') - text = text.decode('utf-8') - rule = Rule(docname, lineno, issue, text) - rules.append(rule) - f.close() - self.info('done, %d rules loaded' % len(self.rules)) - - - def get_lineno(node): -<span class="gd">- "Obtain line number information for a node"</span> -<span class="gi">+ """Obtain line number information for a node."""</span> - lineno = None - while lineno is None and node: - node = node.parent - lineno = node.line - return lineno - - - def extract_line(text, index): - """text may be a multiline string; extract - only the line containing the given character index. - - >>> extract_line("abc\ndefgh\ni", 6) - >>> 'defgh' - >>> for i in (0, 2, 3, 4, 10): - ... print extract_line("abc\ndefgh\ni", i) - abc - abc - abc - defgh - defgh - i - """ - p = text.rfind('\n', 0, index) + 1 - q = text.find('\n', index) -<span class="gd">- if q<0: q = len(text)</span> -<span class="gi">+ if q < 0:</span> -<span class="gi">+ q = len(text)</span> - return text[p:q] - - - class SuspiciousVisitor(nodes.GenericNodeVisitor): - - lastlineno = 0 - - def __init__(self, document, builder): - nodes.GenericNodeVisitor.__init__(self, document) - self.builder = builder - - def default_visit(self, node): - if isinstance(node, (nodes.Text, nodes.image)): # direct text containers - text = node.astext() - # lineno seems to go backwards sometimes (?) - self.lastlineno = lineno = max(get_lineno(node) or 0, self.lastlineno) - seen = set() # don't report the same issue more than only once per line - for match in detect_all(text): -<span class="gd">- #import pdb; pdb.set_trace()</span> - issue = match.group() - line = extract_line(text, match.start()) - if (issue, line) not in seen: - self.builder.check_issue(line, lineno, issue) - seen.add((issue, line)) - - unknown_visit = default_visit - - def visit_document(self, node): - self.lastlineno = 0 - - def visit_comment(self, node): -</pre></div> - -</body> -</html> ======================================= --- /tools/sphinxext/patchlevel.py Fri Dec 19 00:03:21 2008 +++ /tools/sphinxext/patchlevel.py Fri Nov 11 09:46:18 2011 @@ -41,7 +41,7 @@ suffixes = { 'PY_RELEASE_LEVEL_ALPHA': 'a', 'PY_RELEASE_LEVEL_BETA': 'b', - 'PY_RELEASE_LEVEL_GAMMA': 'c', + 'PY_RELEASE_LEVEL_GAMMA': 'rc', } if level != 'PY_RELEASE_LEVEL_FINAL': release += suffixes[level] + str(int(d['PY_RELEASE_SERIAL'])) ======================================= --- /tools/sphinxext/pyspecific.py Mon Dec 6 04:55:49 2010 +++ /tools/sphinxext/pyspecific.py Fri Nov 11 09:46:18 2011 @@ -99,19 +99,8 @@ from docutils.io import StringOutput from docutils.utils import new_document -try: - from sphinx.builders import Builder -except ImportError: - # using Sphinx < 0.6, which has a different package layout - from sphinx.builder import Builder - # monkey-patch toctree directive to accept (and ignore) the :numbered: flag - from sphinx.directives.other import toctree_directive - toctree_directive.options['numbered'] = toctree_directive.options['glob'] - -try: - from sphinx.writers.text import TextWriter -except ImportError: - from sphinx.textwriter import TextWriter +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter class PydocTopicsBuilder(Builder): @@ -128,7 +117,9 @@ def write(self, *ignored): writer = TextWriter(self) - for label in self.status_iterator(pydoc_topic_labels, 'building topics... '): + for label in self.status_iterator(pydoc_topic_labels, + 'building topics... ', + length=len(pydoc_topic_labels)): if label not in self.env.labels: self.warn('label %r not in documentation' % label) continue @@ -141,7 +132,7 @@ self.topics[label] = writer.output def finish(self): - f = open(path.join(self.outdir, 'pydoc_topics.py'), 'w') + f = open(path.join(self.outdir, 'topics.py'), 'w') try: f.write('# Autogenerated by Sphinx on %s\n' % asctime()) f.write('topics = ' + pformat(self.topics) + '\n') ======================================= --- /tools/sphinxext/susp-ignored.csv Wed Apr 8 17:14:23 2009 +++ /tools/sphinxext/susp-ignored.csv Fri Nov 11 09:46:18 2011 @@ -162,3 +162,139 @@ whatsnew/2.5,,:memory,:memory: whatsnew/2.5,,:step,[start:stop:step] whatsnew/2.5,,:stop,[start:stop:step] +distutils/examples,267,`,This is the description of the ``foobar`` package. +documenting/fromlatex,39,:func,:func:`str(object)` +documenting/fromlatex,39,`,:func:`str(object)` +documenting/fromlatex,39,`,``str(object)`` +documenting/fromlatex,55,.. deprecated:,.. deprecated:: 2.5 +documenting/fromlatex,66,.. note:,.. note:: +documenting/fromlatex,76,:samp,":samp:`open({filename}, {mode})`" +documenting/fromlatex,76,`,":samp:`open({filename}, {mode})`" +documenting/fromlatex,80,`,``'c'`` +documenting/fromlatex,80,`,`Title <URL>`_ +documenting/fromlatex,80,`,``code`` +documenting/fromlatex,80,`,`Title <URL>`_ +documenting/fromlatex,99,:file,:file:`C:\\Temp\\my.tmp` +documenting/fromlatex,99,`,:file:`C:\\Temp\\my.tmp` +documenting/fromlatex,99,`,"``open(""C:\Temp\my.tmp"")``" +documenting/fromlatex,129,.. function:,.. function:: do_foo(bar) +documenting/fromlatex,141,.. function:,".. function:: open(filename[, mode[, buffering]])" +documenting/fromlatex,152,.. function:,.. function:: foo_* +documenting/fromlatex,152,:noindex,:noindex: +documenting/fromlatex,162,.. describe:,.. describe:: a == b +documenting/fromlatex,168,.. cmdoption:,.. cmdoption:: -O +documenting/fromlatex,168,.. envvar:,.. envvar:: PYTHONINSPECT +documenting/rest,33,`,``text`` +documenting/rest,47,:rolename,:rolename:`content` +documenting/rest,47,`,:rolename:`content` +documenting/rest,103,::,This is a normal text paragraph. The next paragraph is a code sample:: +documenting/rest,130,`,`Link text <http://target>`_ +documenting/rest,187,.. function:,.. function:: foo(x) +documenting/rest,187,:bar,:bar: no +documenting/rest,208,.. rubric:,.. rubric:: Footnotes +faq/programming,,:reduce,"print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y," +faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro," +faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(" +faq/programming,,::,for x in sequence[::-1]: +faq/windows,229,:EOF, @ setlocal enableextensions & python -x %~f0 %* & goto :EOF +faq/windows,393,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s +library/bisect,,:hi,all(val >= x for val in a[i:hi]) +library/bisect,,:hi,all(val > x for val in a[i:hi]) +library/http.client,52,:port,host:port +library/nntplib,,:bytes,:bytes +library/nntplib,,:lines,:lines +library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" +library/nntplib,,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" +library/pickle,567,:memory,"conn = sqlite3.connect("":memory:"")" +library/profile,293,:lineno,"(sort by filename:lineno)," +library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]" +library/stdtypes,,:end,s[start:end] +library/stdtypes,,:end,s[start:end] +license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +license,,`,"``Software''), to deal in the Software without restriction, including" +license,,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND," +reference/lexical_analysis,704,`,$ ? ` +whatsnew/2.7,735,:Sunday,'2009:4:Sunday' +whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0" +whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0" +whatsnew/2.7,,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo') +whatsnew/2.7,,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]'," +documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum <guido****@pytho*****> +documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access +documenting/markup,42,`,:mod:`parrot` -- Dead parrot access +documenting/markup,42,.. module:,.. module:: parrot +documenting/markup,42,:platform,":platform: Unix, Windows" +documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots. +documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese <eric****@pytho*****> +documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle <john****@pytho*****> +documenting/markup,88,:noindex,:noindex: +documenting/markup,95,.. function:,.. function:: spam(eggs) +documenting/markup,95,:noindex,:noindex: +documenting/markup,101,.. method:,.. method:: FileInput.input(...) +documenting/markup,121,.. cfunction:,".. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)" +documenting/markup,131,.. cmember:,.. cmember:: PyObject* PyTypeObject.tp_bases +documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type +documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])" +documenting/markup,209,.. cmdoption:,.. cmdoption:: -m <module> +documenting/markup,227,.. describe:,.. describe:: opcode +documenting/markup,256,.. highlightlang:,.. highlightlang:: c +documenting/markup,276,.. literalinclude:,.. literalinclude:: example.py +documenting/markup,291,:rolename,:rolename:`content` +documenting/markup,291,`,:rolename:`content` +documenting/markup,296,:role,:role:`title <target>` +documenting/markup,296,`,:role:`title <target>` +documenting/markup,302,:meth,:meth:`~Queue.Queue.get` +documenting/markup,302,`,:meth:`~Queue.Queue.get` +documenting/markup,350,:func,:func:`filter` +documenting/markup,350,`,:func:`filter` +documenting/markup,350,:func,:func:`foo.filter` +documenting/markup,350,`,:func:`foo.filter` +documenting/markup,356,:func,:func:`open` +documenting/markup,356,`,:func:`open` +documenting/markup,356,:func,:func:`.open` +documenting/markup,356,`,:func:`.open` +documenting/markup,435,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... +documenting/markup,435,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... +documenting/markup,454,:kbd,:kbd:`C-x C-f` +documenting/markup,454,`,:kbd:`C-x C-f` +documenting/markup,454,:kbd,:kbd:`Control-x Control-f` +documenting/markup,454,`,:kbd:`Control-x Control-f` +documenting/markup,468,:mailheader,:mailheader:`Content-Type` +documenting/markup,468,`,:mailheader:`Content-Type` +documenting/markup,477,:manpage,:manpage:`ls(1)` +documenting/markup,477,`,:manpage:`ls(1)` +documenting/markup,493,:menuselection,:menuselection:`Start --> Programs` +documenting/markup,493,`,:menuselection:`Start --> Programs` +documenting/markup,508,`,``code`` +documenting/markup,526,:file,:file: +documenting/markup,526,`,``code`` +documenting/markup,561,:ref,:ref:`label-name` +documenting/markup,561,`,:ref:`label-name` +documenting/markup,565,:ref,"It refers to the section itself, see :ref:`my-reference-label`." +documenting/markup,565,`,"It refers to the section itself, see :ref:`my-reference-label`." +documenting/markup,574,:ref,:ref: +documenting/markup,595,.. note:,.. note:: +documenting/markup,622,.. versionadded:,.. versionadded:: 2.5 +documenting/markup,647,::,.. impl-detail:: +documenting/markup,647,::,.. impl-detail:: This shortly mentions an implementation detail. +documenting/markup,667,.. seealso:,.. seealso:: +documenting/markup,667,:mod,Module :mod:`zipfile` +documenting/markup,667,`,Module :mod:`zipfile` +documenting/markup,667,:mod,Documentation of the :mod:`zipfile` standard module. +documenting/markup,667,`,Documentation of the :mod:`zipfile` standard module. +documenting/markup,667,`,"`GNU tar manual, Basic Tar Format <http://link>`_" +documenting/markup,681,.. centered:,.. centered:: +documenting/markup,726,.. toctree:,.. toctree:: +documenting/markup,726,:maxdepth,:maxdepth: 2 +documenting/markup,742,.. index:,.. index:: +documenting/markup,772,.. index:,".. index:: BNF, grammar, syntax, notation" +documenting/markup,803,`,"unaryneg ::= ""-"" `integer`" +documenting/markup,808,.. productionlist:,.. productionlist:: +documenting/markup,808,`,"try1_stmt: ""try"" "":"" `suite`" +documenting/markup,808,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+" +documenting/markup,808,`,": [""else"" "":"" `suite`]" +documenting/markup,808,`,": [""finally"" "":"" `suite`]" +documenting/markup,808,`,"try2_stmt: ""try"" "":"" `suite`" +documenting/markup,808,`,": ""finally"" "":"" `suite`" +library/urllib2,67,:close,Connection:close ======================================= --- /tools/sphinxext/suspicious.py Mon Dec 6 04:55:49 2010 +++ /tools/sphinxext/suspicious.py Fri Nov 11 09:46:18 2011 @@ -41,16 +41,13 @@ """ -import os, sys -import csv +import os import re +import csv +import sys + from docutils import nodes - -try: - from sphinx.builders import Builder -except ImportError: - from sphinx.builder import Builder - +from sphinx.builders import Builder detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=) @@ -59,9 +56,10 @@ (?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT ... else:) ''', re.UNICODE | re.VERBOSE).finditer + class Rule: def __init__(self, docname, lineno, issue, line): - "A rule for ignoring issues" + """A rule for ignoring issues""" self.docname = docname # document to which this rule applies self.lineno = lineno # line number in the original source; # this rule matches only near that. @@ -70,9 +68,15 @@ self.line = line # text of the container element (single line only) + +class dialect(csv.excel): + """Our dialect: uses only linefeed as newline.""" + lineterminator = '\n' + + class CheckSuspiciousMarkupBuilder(Builder): """ - Checks for possibly invalid markup that may leak into the output + Checks for possibly invalid markup that may leak into the output. """ name = 'suspicious' @@ -81,7 +85,8 @@ self.log_file_name = os.path.join(self.outdir, 'suspicious.csv') open(self.log_file_name, 'w').close() # load database of previously ignored issues - self.load_rules(os.path.join(os.path.dirname(__file__), 'susp-ignored.csv')) + self.load_rules(os.path.join(os.path.dirname(__file__), + 'susp-ignored.csv')) def get_outdated_docs(self): return self.env.found_docs @@ -90,14 +95,11 @@ return '' def prepare_writing(self, docnames): - ### PYTHON PROJECT SPECIFIC ### - for name in set(docnames): - if name.split('/', 1)[0] == 'documenting': - docnames.remove(name) - ### PYTHON PROJECT SPECIFIC ### + pass def write_doc(self, docname, doctree): - self.any_issue = False # set when any issue is encountered in this document + # set when any issue is encountered in this document + self.any_issue = False self.docname = docname visitor = SuspiciousVisitor(doctree, self) doctree.walk(visitor) @@ -110,8 +112,7 @@ self.report_issue(line, lineno, issue) def is_ignored(self, line, lineno, issue): - """Determine whether this issue should be ignored. - """ + """Determine whether this issue should be ignored.""" docname = self.docname for rule in self.rules: if rule.docname != docname: continue @@ -144,12 +145,11 @@ def write_log_entry(self, lineno, issue, text): f = open(self.log_file_name, 'ab') - writer = csv.writer(f) + writer = csv.writer(f, dialect) writer.writerow([self.docname.encode('utf-8'), - lineno, - issue.encode('utf-8'), - text.strip().encode('utf-8')]) - del writer + lineno, + issue.encode('utf-8'), + text.strip().encode('utf-8')]) f.close() def load_rules(self, filename): @@ -164,7 +164,8 @@ except IOError: return for i, row in enumerate(csv.reader(f)): if len(row) != 4: - raise ValueError("wrong format in %s, line %d: %s" % (filename, i+1, row)) + raise ValueError( + "wrong format in %s, line %d: %s" % (filename, i+1, row)) docname, lineno, issue, text = row docname = docname.decode('utf-8') if lineno: lineno = int(lineno) @@ -178,7 +179,7 @@ def get_lineno(node): - "Obtain line number information for a node" + """Obtain line number information for a node.""" lineno = None while lineno is None and node: node = node.parent @@ -203,7 +204,8 @@ """ p = text.rfind('\n', 0, index) + 1 q = text.find('\n', index) - if q<0: q = len(text) + if q < 0: + q = len(text) return text[p:q] @@ -222,7 +224,6 @@ self.lastlineno = lineno = max(get_lineno(node) or 0, self.lastlineno) seen = set() # don't report the same issue more than only once per line for match in detect_all(text): - #import pdb; pdb.set_trace() issue = match.group() line = extract_line(text, match.start()) if (issue, line) not in seen: ============================================================================== Revision: 7071be001d84 Author: Naoki INADA <inada****@klab*****> Date: Fri Nov 11 09:47:58 2011 Log: Update conf.py http://code.google.com/p/python-doc-ja/source/detail?r=7071be001d84 Modified: /conf.py /whatsnew/2.7.rst ======================================= --- /conf.py Fri Oct 28 22:59:57 2011 +++ /conf.py Fri Nov 11 09:47:58 2011 @@ -39,7 +39,7 @@ # and replace the values accordingly. #import patchlevel #version, release = patchlevel.get_version_info() -version, release = '2.6', '2.6ja2' +version, release = '2.7', '2.7ja1-dev' language = 'ja' @@ -85,7 +85,7 @@ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = '%Y-%m-%d' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. ======================================= --- /whatsnew/2.7.rst Fri Nov 11 09:04:51 2011 +++ /whatsnew/2.7.rst Fri Nov 11 09:47:58 2011 @@ -254,65 +254,65 @@ .. _pep-0378: -PEP 378: Format Specifier for Thousands Separator -================================================= - -To make program output more readable, it can be useful to add -separators to large numbers, rendering them as -18,446,744,073,709,551,616 instead of 18446744073709551616. - -The fully general solution for doing this is the :mod:`locale` module, -which can use different separators ("," in North America, "." in -Europe) and different grouping sizes, but :mod:`locale` is complicated -to use and unsuitable for multi-threaded applications where different -threads are producing output for different locales. - -Therefore, a simple comma-grouping mechanism has been added to the -mini-language used by the :meth:`str.format` method. When -formatting a floating-point number, simply include a comma between the -width and the precision:: +.. PEP 378: Format Specifier for Thousands Separator + +PEP 378: 1000区切りのための書式指定子 +======================================= + +大きい数値に区切り文字を追加して、 18446744073709551616 の代わりに +18,446,744,073,709,551,616 と出力すると、プログラムの出力を読みやすくできま す。 + +これを行う一般的な方法は :mod:`locale` モジュールを使うことで、 +複数の区切り文字 (北米では "," で、ヨーロッパでは ".") +を使ったり、複数のグループの大きさを使うことができます。 +しかし、 :mod:`locale` の利用方法は複雑ですし、スレッドごとに異なるロケール の +出力を行うプログラムでは利用することができません。 + +そのため、シンプルなカンマによるグループ化機構が :meth:`str.format` +メソッドのミニ言語に追加されました。浮動小数点数をフォーマットする場合、 +シンプルにカンマを幅と精度の間に置きます。 >>> '{:20,.2f}'.format(18446744073709551616.0) '18,446,744,073,709,551,616.00' -When formatting an integer, include the comma after the width: +整数をフォーマットする場合は、幅の後にカンマを追加します。 >>> '{:20,d}'.format(18446744073709551616) '18,446,744,073,709,551,616' -This mechanism is not adaptable at all; commas are always used as the -separator and the grouping is always into three-digit groups. The -comma-formatting mechanism isn't as general as the :mod:`locale` -module, but it's easier to use. +この機構は全く柔軟性を持っていません。区切り文字は常にカンマですし、 +グループは常に数字3つになります。 +カンマ書式機構は :mod:`locale` ほど汎用ではありませんが、手軽に使うことがで きます。 .. seealso:: :pep:`378` - Format Specifier for Thousands Separator PEP written by Raymond Hettinger; implemented by Eric Smith. -PEP 389: The argparse Module for Parsing Command Lines -====================================================== - -The :mod:`argparse` module for parsing command-line arguments was -added as a more powerful replacement for the -:mod:`optparse` module. - -This means Python now supports three different modules for parsing -command-line arguments: :mod:`getopt`, :mod:`optparse`, and -:mod:`argparse`. The :mod:`getopt` module closely resembles the C -library's :cfunc:`getopt` function, so it remains useful if you're writing a -Python prototype that will eventually be rewritten in C. -:mod:`optparse` becomes redundant, but there are no plans to remove it -because there are many scripts still using it, and there's no -automated way to update these scripts. (Making the :mod:`argparse` -API consistent with :mod:`optparse`'s interface was discussed but -rejected as too messy and difficult.) - -In short, if you're writing a new script and don't need to worry -about compatibility with earlier versions of Python, use -:mod:`argparse` instead of :mod:`optparse`. - -Here's an example:: + +.. PEP 389: The argparse Module for Parsing Command Lines + +PEP 389: コマンドライン解析のための argparse モジュール +======================================================== + +コマンドライン引数の解析のための :mod:`argparse` モジュールが、 +:mod:`optparse` モジュールのより協力な代替として追加されました。 + +これにより、 Python はコマンドライン引数の解析のために3つの異なる +モジュール、 :mod:`getopt`, :mod:`optparse`, :mod:`argparse` を +持つことになります。 +:mod:`getopt` モジュールは C言語用ライブラリの :c:func:`getopt` 関数に似せ てあるので、 +あとで C 言語で書き直すかもしれないプログラムのプロトタイプを Python で書く 場合に +役に立ちます。 +:mod:`optparse` は冗長になってしまいましたが、まだたくさんのスクリプトが利 用していて、 +それらのスクリプトを自動的に更新する手段が無いので、削除される予定はありま せん。 +(:mod:`argparse` API を :mod:`optparse` のインタフェースに適合させる方法も +検討されましたが、多くの複雑さと難点のために却下されました) + +古いバージョンの Python との互換性を気にすること無く新しいスクリプトを書く 時は、 +:mod:`optparse` の代わりに :mod:`argparse` を使ってください。 + +例:: import argparse @@ -335,8 +335,8 @@ args = parser.parse_args() print args.__dict__ -Unless you override it, :option:`-h` and :option:`--help` switches -are automatically added, and produce neatly formatted output:: +オーバーライドしない限り、 :option:`-h` と :option:`--help` スイッチが +自動的に追加され、綺麗にフォーマットした出力を生成します。 :: -> ./python.exe argparse-example.py --help usage: argparse-example.py [-h] [-v] [-o FILE] [-C NUM] [inputs [inputs ...]] @@ -352,8 +352,8 @@ -o FILE direct output to FILE instead of stdout -C NUM display NUM lines of added context -As with :mod:`optparse`, the command-line switches and arguments -are returned as an object with attributes named by the *dest* parameters:: +:mod:`optparse` と同じく、コマンドラインスイッチと引数は、 *dest* 引数の +名前の属性をもったオブジェクトとして返されます。 :: -> ./python.exe argparse-example.py -v {'output': None, @@ -377,19 +377,29 @@ automatically open files for you and understands that ``'-'`` means standard input or output. +:mod:`argparse` は :mod:`optparse` よりも多くの便利なバリデーションを持って います。 +引数の正確な数を整数で指定したり、 ``'*'`` で0以上の数を指定したり、 +``'+'`` で1以上の数を指定したり、 ``'?'`` でオプションにしたりできます。 +トップレベルのパーサーはサブパーサーを持つことができ、 ``svn commit``, +``svn update`` のように異なるオプションを持ったサブコマンドを定義できます。 +引数のタイプに :class:`~argparse.FileType` を指定することで、 +自動でファイルを開き、 ``'-'`` が指定されたときに標準入出力だと判断すること ができます。 + .. seealso:: - :mod:`argparse` documentation - The documentation page of the argparse module. + :mod:`argparse` のドキュメント + argparse モジュールのドキュメント :ref:`argparse-from-optparse` - Part of the Python documentation, describing how to convert - code that uses :mod:`optparse`. + :mod:`optparse` を使うコードを変換する方法を説明した Python のドキュメ ントの一部 :pep:`389` - argparse - New Command Line Parsing Module PEP written and implemented by Steven Bethard. -PEP 391: Dictionary-Based Configuration For Logging + +.. PEP 391: Dictionary-Based Configuration For Logging + +PEP 391: logging の辞書ベースの設定 ==================================================== The :mod:`logging` module is very flexible; applications can define