Georg Brandl avatar Georg Brandl committed fdf5265

Remove traces of PEP8 torture.

Comments (0)

Files changed (2)


-This is based on by `Chad Miller`_.
+This is based on by `Chad Miller`_ <>,
+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 <>"
-__version__ = "1.5_1.5: Sat, 13 Aug 2005 15:50:24 -0400"
-__url__ = ""
-__description__ = \
-    "Smart-quotes, smart-ellipses, and smart-dashes for weblog entries" \
-    " in pyblosxom"


 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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.