1. Georg Brandl
  2. sphinx


Georg Brandl  committed fdf5265

Remove traces of PEP8 torture.

  • Participants
  • Parent commits cbb3c04
  • Branches default

Comments (0)

Files changed (2)

File sphinx/util/smartypants.py

View file
-This is based on SmartyPants.py by `Chad Miller`_.
+This is based on SmartyPants.py by `Chad Miller`_ <smartypantspy@chad.org>,
+version 1.5_1.6.
 Copyright and License
 def sphinx_smarty_pants(t):
     t = t.replace('&quot;', '"')
-    t = educateDashesOldSchool(t)
-    t = educateQuotes(t)
+    t = educate_dashes_oldschool(t)
+    t = educate_quotes(t)
     t = t.replace('"', '&quot;')
     return t
                 (\s | s\b)
                 """ % (close_class,), re.VERBOSE)
-def educateQuotes(s):
+def educate_quotes(s):
     Parameter:  String.
     return s.replace('"', "&#8220;")
-def educateQuotesLatex(s, dquotes=("``", "''")):
+def educate_quotes_latex(s, dquotes=("``", "''")):
     Parameter:  String.
            replace("\x03", "`").replace("\x04", "'")
-def educateBackticks(s):
+def educate_backticks(s):
     Parameter:  String.
     Returns:    The string, with ``backticks'' -style double quotes
     return s.replace("``", "&#8220;").replace("''", "&#8221;")
-def educateSingleBackticks(s):
+def educate_single_backticks(s):
     Parameter:  String.
     Returns:    The string, with `backticks' -style single quotes
     return s.replace('`', "&#8216;").replace("'", "&#8217;")
-def educateDashesOldSchool(s):
+def educate_dashes_oldschool(s):
     Parameter:  String.
     return s.replace('---', "&#8212;").replace('--', "&#8211;")
-def educateDashesOldSchoolInverted(s):
+def educate_dashes_oldschool_inverted(s):
     Parameter:  String.
         an em-dash HTML entity, and each "---" translated to
         an en-dash HTML entity. Two reasons why: First, unlike the
         en- and em-dash syntax supported by
-        EducateDashesOldSchool(), it's compatible with existing
+        educate_dashes_oldschool(), it's compatible with existing
         entries written before SmartyPants 1.1, back when "--" was
         only used for em-dashes.  Second, em-dashes are more
         common than en-dashes, and so it sort of makes sense that
     return s.replace('---', "&#8211;").replace('--', "&#8212;")
-def educateEllipses(s):
+def educate_ellipses(s):
     Parameter:  String.
     Returns:    The string, with each instance of "..." translated to
     Example output: Huh&#8230;?
     return s.replace('...', "&#8230;").replace('. . .', "&#8230;")
-__author__ = "Chad Miller <smartypantspy@chad.org>"
-__version__ = "1.5_1.5: Sat, 13 Aug 2005 15:50:24 -0400"
-__url__ = "http://wiki.chad.org/SmartyPantsPy"
-__description__ = \
-    "Smart-quotes, smart-ellipses, and smart-dashes for weblog entries" \
-    " in pyblosxom"

File sphinx/writers/latex.py

View file
 from sphinx.util.osutil import ustrftime
 from sphinx.util.pycompat import any
 from sphinx.util.texescape import tex_escape_map, tex_replace_map
-from sphinx.util.smartypants import educateQuotesLatex
+from sphinx.util.smartypants import educate_quotes_latex
 HEADER = r'''%% Generated by Sphinx.
             self.verbatim += node.astext()
             text = self.encode(node.astext())
-            self.body.append(educateQuotesLatex(text))
+            self.body.append(educate_quotes_latex(text))
     def depart_Text(self, node):