changeset 2259:709eea9354c7

text_moin_wiki: some small PEP8 changes, that version should go into 1.6 too
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 26 Jun 2007 20:56:12 +0200
parents 9c66c14f6b62
children c9a4fbbb2b2e
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 3 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Tue Jun 26 20:46:11 2007 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Tue Jun 26 20:56:12 2007 +0200
@@ -184,7 +184,6 @@
             result.append(self.formatter.definition_desc(0))
         #result.append("<!-- close item end -->\n")
 
-
     def interwiki(self, target_and_text, **kw):
         # TODO: maybe support [wiki:Page http://wherever/image.png] ?
         scheme, rest = target_and_text.split(':', 1)
@@ -240,7 +239,7 @@
                     pagename = self.formatter.page.page_name
                     url = AttachFile.getAttachUrl(pagename, fname, self.request, escaped=1)
                     return self.formatter.rawHTML(EmbedObject.embed(EmbedObject(macro, wikiutil.escape(fname)), mt, url))
-    
+
         return self.formatter.attachment_link(fname, text)
 
     def _u_repl(self, word):
@@ -280,7 +279,7 @@
 
     def _emph_repl(self, word):
         """Handle emphasis, i.e. '' and '''."""
-        ##print "#", self.is_b, self.is_em, "#"
+        ## print "#", self.is_b, self.is_em, "#"
         if len(word) == 3:
             self.is_b = not self.is_b
             if self.is_em and self.is_b:
@@ -310,7 +309,7 @@
 
     def _emph_ib_or_bi_repl(self, word):
         """Handle mixed emphasis, exactly five '''''."""
-        ##print "*", self.is_b, self.is_em, "*"
+        ## print "*", self.is_b, self.is_em, "*"
         b_before_em = self.is_b > self.is_em > 0
         self.is_b = not self.is_b
         self.is_em = not self.is_em
@@ -319,7 +318,6 @@
         else:
             return self.formatter.emphasis(self.is_em) + self.formatter.strong(self.is_b)
 
-
     def _sup_repl(self, word):
         """Handle superscript."""
         return self.formatter.sup(1) + \
@@ -344,7 +342,6 @@
             result = result + self.formatter.rule(size)
         return result
 
-
     def _word_repl(self, word, text=None):
         """Handle WikiNames."""
 
@@ -355,7 +352,6 @@
             if not text:
                 text = word
             word = '/'.join([x for x in self.formatter.page.page_name.split('/')[:-1] + [word[wikiutil.PARENT_PREFIX_LEN:]] if x])
-
         if not text:
             # if a simple, self-referencing link, emit it as plain text
             if word == self.formatter.page.page_name:
@@ -407,7 +403,6 @@
                     self.formatter.text(word) +
                     self.formatter.url(0))
 
-
     def _wikiname_bracket_repl(self, text):
         """Handle special-char wikinames with link text, like:
            ["Jim O'Brian" Jim's home page] or ['Hello "world"!' a page with doublequotes]i
@@ -426,7 +421,6 @@
         else:
             return self.formatter.text(text)
 
-
     def _url_bracket_repl(self, word):
         """Handle bracketed URLs."""
         word = word[1:-1] # strip brackets
@@ -470,14 +464,12 @@
                     self.formatter.text(words[1]) +
                     self.formatter.url(0))
 
-
     def _email_repl(self, word):
         """Handle email addresses (without a leading mailto:)."""
         return (self.formatter.url(1, "mailto:" + word, css='mailto') +
                 self.formatter.text(word) +
                 self.formatter.url(0))
 
-
     def _ent_repl(self, word):
         """Handle SGML entities."""
         return self.formatter.text(word)
@@ -544,12 +536,10 @@
         ])
         return ''.join(result)
 
-
     def _indent_level(self):
         """Return current char-wise indent level."""
         return len(self.list_indents) and self.list_indents[-1]
 
-
     def _indent_to(self, new_level, list_type, numtype, numstart):
         """Close and open lists."""
         openlist = []   # don't make one out of these two statements!
@@ -606,7 +596,6 @@
         self.in_list = self.list_types != []
         return ''.join(closelist) + ''.join(openlist)
 
-
     def _undent(self):
         """Close all open lists."""
         result = []
@@ -624,14 +613,12 @@
         self.list_types = []
         return ''.join(result)
 
-
     def _tt_repl(self, word):
         """Handle inline code."""
         return self.formatter.code(1) + \
             self.formatter.text(word[3:-3]) + \
             self.formatter.code(0)
 
-
     def _tt_bt_repl(self, word):
         """Handle backticked inline code."""
         # if len(word) == 2: return "" // removed for FCK editor
@@ -639,7 +626,6 @@
             self.formatter.text(word[1:-1]) + \
             self.formatter.code(0)
 
-
     def _getTableAttrs(self, attrdef):
         # skip "|" and initial "<"
         while attrdef and attrdef[0] == "|":
@@ -775,7 +761,6 @@
         else:
             return self.formatter.text(word)
 
-
     def _heading_repl(self, word):
         """Handle section headings."""
         import sha
@@ -854,14 +839,12 @@
             return self.formatter.text(word)
         return self.formatter.text(word)
 
-
     def _smiley_repl(self, word):
         """Handle smileys."""
         return self.formatter.smiley(word)
 
     _smileyA_repl = _smiley_repl
 
-
     def _comment_repl(self, word):
         # if we are in a paragraph, we must close it so that normal text following
         # in the line below the comment will reopen a new paragraph.
@@ -1069,7 +1052,6 @@
                         else:
                             if self.in_nested_pre == 1:
                                 endpos = line.index("}}}")
-
                             else:
                                 self.parser_lines.append(line)
                                 if "}}}" in line: