Attachment 'text_plain.py.diff'

Download

   1 --- MoinMoin/formatter/text_plain.py.orig	2005-11-18 14:24:24.000000000 -0500
   2 +++ MoinMoin/formatter/text_plain.py	2006-01-12 14:31:40.000000000 -0500
   3 @@ -79,27 +79,27 @@
   4      def attachment_drawing(self, url, text, **kw):
   5          return "[drawing:%s]" % text
   6      
   7 -    def text(self, text):
   8 +    def text(self, text, **kw):
   9          self._did_para = 0
  10          if self._text is not None:
  11              self._text.append(text)
  12          return text
  13  
  14 -    def rule(self, size=0):
  15 +    def rule(self, size=0, **kw):
  16          size = min(size, 10)
  17          ch = u"---~=*+#####"[size]
  18          return (ch * 79) + u'\n'
  19  
  20 -    def strong(self, on):
  21 +    def strong(self, on, **kw):
  22          return u'*'
  23  
  24 -    def emphasis(self, on):
  25 +    def emphasis(self, on, **kw):
  26          return u'/'
  27  
  28 -    def highlight(self, on):
  29 +    def highlight(self, on, **kw):
  30          return u''
  31  
  32 -    def number_list(self, on, type=None, start=None):
  33 +    def number_list(self, on, type=None, start=None, **kw):
  34          if on:
  35              self._in_list = 1
  36              return [u'\n', u'\n\n'][not self._did_para]
  37 @@ -110,7 +110,7 @@
  38                  return u'\n'
  39          return u''
  40  
  41 -    def bullet_list(self, on):
  42 +    def bullet_list(self, on, **kw):
  43          if on:
  44              self._in_list = -1
  45              return [u'\n', u'\n\n'][not self._did_para]
  46 @@ -136,20 +136,20 @@
  47              self._did_para = 1
  48              return u'\n'
  49          
  50 -    def sup(self, on):
  51 +    def sup(self, on, **kw):
  52          return u'^'
  53  
  54 -    def sub(self, on):
  55 +    def sub(self, on, **kw):
  56          return u'_'
  57  
  58 -    def strike(self, on):
  59 +    def strike(self, on, **kw):
  60          return u'__'
  61  
  62      def code(self, on, **kw):
  63          #return [unichr(0x60), unichr(0xb4)][not on]
  64          return u"'" # avoid high-ascii
  65  
  66 -    def preformatted(self, on):
  67 +    def preformatted(self, on, **kw):
  68          FormatterBase.preformatted(self, on)
  69          snip = u'---%<'
  70          snip = snip + (u'-' * (78 - len(snip)))
  71 @@ -158,10 +158,10 @@
  72          else:
  73              return snip + u'\n'
  74  
  75 -    def small(self, on):
  76 +    def small(self, on, **kw):
  77          return u''
  78  
  79 -    def big(self, on):
  80 +    def big(self, on, **kw):
  81          return u''
  82  
  83      def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
  84 @@ -191,7 +191,7 @@
  85      def code_token(self, on, tok_type):
  86          return ""
  87  
  88 -    def paragraph(self, on):
  89 +    def paragraph(self, on, **kw):
  90          FormatterBase.paragraph(self, on)
  91          if self._did_para:
  92              on = 0
  93 @@ -212,33 +212,34 @@
  94              self._text = None
  95              return result
  96  
  97 -    def table(self, on, attrs={}):
  98 +    def table(self, on, attrs={}, **kw):
  99          return u''
 100  
 101 -    def table_row(self, on, attrs={}):
 102 +    def table_row(self, on, attrs={}, **kw):
 103          return u''
 104  
 105 -    def table_cell(self, on, attrs={}):
 106 +    def table_cell(self, on, attrs={}, **kw):
 107          return u''
 108  
 109 -    def underline(self, on):
 110 +    def underline(self, on, **kw):
 111          return u'_'
 112  
 113 -    def definition_list(self, on):
 114 +    def definition_list(self, on, **kw):
 115          return u''
 116  
 117 -    def definition_term(self, on, compact=0):
 118 +    def definition_term(self, on, compact=0, **kw):
 119          result = u''
 120          if not compact: result = result + u'\n'
 121          if not on: result = result + u':\n'
 122          return result
 123  
 124 -    def definition_desc(self, on):
 125 +    def definition_desc(self, on, **kw):
 126          return [u'    ', u'\n'][not on]
 127  
 128 -    def image(self, **kw):
 129 -        if kw.has_key(u'alt'):
 130 -            return kw[u'alt']
 131 +    def image(self, src=None, **kw):
 132 +        for a in (u'alt',u'title'):
 133 +            if kw.has_key(a):
 134 +                return kw[a]
 135          return u''
 136  
 137      def lang(self, on, lang_name):

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-01-12 20:03:22, 4.3 KB) [[attachment:base.py.diff]]
  • [get | view] (2006-01-12 20:03:35, 4.0 KB) [[attachment:dom_xml.py.diff]]
  • [get | view] (2006-01-19 20:12:28, 67.9 KB) [[attachment:formatter-patch-r4.diff]]
  • [get | view] (2006-01-16 20:11:38, 58.7 KB) [[attachment:formatter-patch.diff]]
  • [get | view] (2006-01-12 20:03:43, 2.0 KB) [[attachment:text_gedit.py.diff]]
  • [get | view] (2006-01-12 20:03:51, 25.7 KB) [[attachment:text_html.py.diff]]
  • [get | view] (2006-01-12 20:03:58, 3.7 KB) [[attachment:text_plain.py.diff]]
  • [get | view] (2006-01-12 20:04:06, 4.0 KB) [[attachment:text_xml.py.diff]]
  • [get | view] (2006-01-12 20:04:11, 5.1 KB) [[attachment:xml_docbook.py.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.