From 72e48560be4a6a3b9237556a7c336bc739fb4f3f Mon Sep 17 00:00:00 2001 From: Rob Reilink Date: Tue, 13 Mar 2012 17:55:34 +0100 Subject: [PATCH 1/6] fixed encoding for hashing functions for Python 3 --- sphinx/ext/graphviz.py | 4 +++- sphinx/ext/inheritance_diagram.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index ee935945d..4e72761e9 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -121,9 +121,11 @@ class GraphvizSimple(Directive): def render_dot(self, code, options, format, prefix='graphviz'): """Render graphviz code into a PNG or PDF output file.""" - hashkey = code.encode('utf-8') + str(options) + \ + hashkey = (code + str(options) + \ str(self.builder.config.graphviz_dot) + \ str(self.builder.config.graphviz_dot_args) + ).encode('utf-8') + fname = '%s-%s.%s' % (prefix, sha(hashkey).hexdigest(), format) if hasattr(self.builder, 'imgpath'): # HTML diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index 7dc57ab12..be7a6766a 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -39,7 +39,7 @@ r""" import re import sys import inspect -import __builtin__ +import __builtin__ as __builtin__ # as __builtin__ is for lib2to3 compatibility try: from hashlib import md5 except ImportError: @@ -314,7 +314,8 @@ class InheritanceDiagram(Directive): def get_graph_hash(node): - return md5(node['content'] + str(node['parts'])).hexdigest()[-10:] + encoded = (node['content'] + str(node['parts'])).encode('utf-8') + return md5(encoded).hexdigest()[-10:] def html_visit_inheritance_diagram(self, node): From 1949bb17e790aead695b54fedb797ca6ded00022 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 17 Mar 2012 16:51:47 +0100 Subject: [PATCH 2/6] Fixes #900: remove Nepali translations that must be wrong --- sphinx/locale/ne/LC_MESSAGES/sphinx.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/locale/ne/LC_MESSAGES/sphinx.po b/sphinx/locale/ne/LC_MESSAGES/sphinx.po index 5cb11e208..9dc24c83a 100644 --- a/sphinx/locale/ne/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ne/LC_MESSAGES/sphinx.po @@ -600,7 +600,7 @@ msgstr "नेभिगेसन " #: sphinx/themes/basic/layout.html:122 #, python-format msgid "Search within %(docstitle)s" -msgstr "भित्र-भित्रै खोज्नुहोस्" +msgstr "" #: sphinx/themes/basic/layout.html:131 msgid "About these documents" @@ -630,12 +630,12 @@ msgstr "यो भन्दा अगाडी %(last_updated)s मा अपड msgid "" "Created using Sphinx " "%(sphinx_version)s." -msgstr "Sphinx प्रयोग गरेर बनाइएको" +msgstr "" #: sphinx/themes/basic/opensearch.xml:4 #, python-format msgid "Search %(docstitle)s" -msgstr "खोज्नुहोस्" +msgstr "" #: sphinx/themes/basic/relations.html:11 msgid "Previous topic" From fe8ed35dfbc250e4a9d4629a897a18d97f9bbe26 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 17 Mar 2012 16:54:17 +0100 Subject: [PATCH 3/6] Make it clearer how autodoc special comments have to be formatted. --- doc/ext/autodoc.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst index ab520f70c..859ca6fc2 100644 --- a/doc/ext/autodoc.rst +++ b/doc/ext/autodoc.rst @@ -194,12 +194,13 @@ inserting them into the page source under a suitable :rst:dir:`py:module`, automethod autoattribute - These work exactly like :rst:dir:`autoclass` etc., but do not offer the options - used for automatic member documentation. + These work exactly like :rst:dir:`autoclass` etc., but do not offer the + options used for automatic member documentation. For module data members and class attributes, documentation can either be put - into a special-formatted comment, or in a docstring *after* the definition. - Comments need to be either on a line of their own *before* the definition, or + into a comment with special formatting (using a ``#:`` to start the comment + instead of just ``#``), or in a docstring *after* the definition. Comments + need to be either on a line of their own *before* the definition, or immediately after the assignment *on the same line*. The latter form is restricted to one line only. From 8b5ba50d248a1fe2a0dbc5905dafe76ae865ebe7 Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sun, 25 Mar 2012 14:37:08 +0900 Subject: [PATCH 4/6] fix wrong translation 'built-in class' for Japanese --- sphinx/locale/ja/LC_MESSAGES/sphinx.mo | Bin 10186 -> 10077 bytes sphinx/locale/ja/LC_MESSAGES/sphinx.po | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo index 2bbd3b24befffe2d7751c913c77273bc36343a3d..c2bf5ac21f5ee916d5ca0d53eab8c4b149ad6034 100644 GIT binary patch delta 2732 zcmYM!e`u9e9Dwno&gs-?Tgz?E>78z~iP!?&Ky=nfv(z~X%g6~*D@st)l*07VG!(%Z z-K4@%R+?#$u9;ab#6MgnnMP4KGFTg1(Lb)?FQn*syayV0_j7)q@A;nhz2}x(u1o%w zo3SVGx1ay<{Ldb0?f<{!BSIKOwE?s7d7OkVVHWO<9>5&xM=%dh;~4xIo!^VjAHb0~ zh%fq+A)CTz8j8^crlmVV4LYF?@5JRe7T4k(xE-DMHYV^OI{z&437vcyU@toF3Oa8X z(d1(R7P5b+q~Hb*<2YP_1^6=Z32*Ra|9e=7ZCHipaUy0A}vh^@~`;{^3$=DBw60LkSMUd(Z`{(G3>I{wDM!ucHCKk1p7bp7ad5;jg#^dodHM z$T!&!bI<@6nEz@DPgC&PTadBg19X8_41+>Ai7wpEt_JucnvpIXj8|j*24+wn#XUGb z2VJ)aJxEEk8lAs5hy0gNSV@C>ZAG#gQn9`dz00Gqy&XNlx5y{_6zjd{#{Fo3*U*e) zyM(0gNAM)vF<`(9X|5^&q(BR1rVJV(KBfN|T)Q_g{U-W8*(rIAXXuS~aFF~LF zyJPp8#bT;tU>Q=6MFJj(Udi#8-IdMJc@k6SA6-lT!`&| zpd0>;Ud63w77u{y=A(fXBflfbP!>BDppn-_m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&VmTG54Xp!3Wt z#gK)*Ern?N-ROc-(5slyVG?FjFz^C&$BWS)mSwShBf9e~(f6af(D5zk2KJ*HI~4oB zLKi%NruuZOUqUl|t-YQ5Pw@zQ1v%)$HWm$7iY`12eZL=y^#y1~YS5FtfSzb2I`2(% z;kR%(Z^=98{Cv{k_zCENOL4I8e;EZ+_H;Cf1J)te9U9TAXpa4d&=Z`D{TI*$t|M!O zzEteL136@vh&;dHVf3K$k)dG)CjR0zQqaBVMvkIy!5JKZ*JFPXjrLDOQ(A#u)m&sq zco_?^35)Rn`iz`I$GN)WhM*gqG?4e-hH@H4;zBIJ1~kyoSpOM)9S0H3--T){!d2)M z?Tqe4Q@;=A;9>Nc7{rt9iASSXP=<7cihT0#Pi+kio@_U=Ryd4KY(<}mHZ;HuG(g`1 z9#AYmH?S_c84dg%&cK7{`0kv>`8nwL(OAQ?aaTgY0o&3Y3pS$z_oD+(pm%r*9d{LN zzY*->UnIx5*$N)Cr-y7&^X0II{NQLGdvfGmxSdM47e5zv;j@|R&?Q(*na@s z`H|Rv1|5Gnw%62449!>tG9*;T_BCim8nA%%!;aYTdF(ijZs;QVnp{Iqlp5L* zxCa_IFFF!a)F+`Qdmvhg#;Hcf*T(wF*#8D5PI#9>3iqHBK0zmZhMwfRSU-y?>etY5 zH_?-4a%@vP9NRa5&Z|Vn&x!r>(TuH#)(>NP1`V5NFeOcBfEIM(rwy~S3cIF Date: Wed, 11 Apr 2012 21:08:39 +0200 Subject: [PATCH 5/6] the epub-cover.html template should not contain any additional blocks --- sphinx/themes/epub/epub-cover.html | 1 + 1 file changed, 1 insertion(+) diff --git a/sphinx/themes/epub/epub-cover.html b/sphinx/themes/epub/epub-cover.html index f80889250..b3202a33f 100644 --- a/sphinx/themes/epub/epub-cover.html +++ b/sphinx/themes/epub/epub-cover.html @@ -8,6 +8,7 @@ :license: BSD, see LICENSE for details. #} {% extends "layout.html" %} +{%- block header %}{% endblock %} {%- block rootrellink %}{% endblock %} {%- block relbaritems %}{% endblock %} {%- block sidebarlogo %}{% endblock %} From 88e852aa7e4de3de28f214749db601ef2a6d4a00 Mon Sep 17 00:00:00 2001 From: ms4py Date: Fri, 16 Mar 2012 10:45:51 +0100 Subject: [PATCH 6/6] Create link to full size image if it is scaled with width or height. --- sphinx/builders/html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 818403744..f5218673f 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -610,7 +610,8 @@ class StandaloneHTMLBuilder(Builder): """ Builder.post_process_images(self, doctree) for node in doctree.traverse(nodes.image): - if not node.has_key('scale') or \ + scale_keys = ('scale', 'width', 'height') + if not any((key in node) for key in scale_keys) or \ isinstance(node.parent, nodes.reference): # docutils does unfortunately not preserve the # ``target`` attribute on images, so we need to check