Attachment 'formatter.diff'

Download

   1 diff -urN formatter.orig/base.py formatter/base.py
   2 --- formatter.orig/base.py	2005-01-10 02:48:50.000000000 +0800
   3 +++ formatter/base.py	2005-11-27 15:43:04.000000000 +0800
   4 @@ -189,7 +189,7 @@
   5  
   6      # Lists ##############################################################
   7  
   8 -    def number_list(self, on, type=None, start=None):
   9 +    def number_list(self, on, type=None, start=None, style=None):
  10          raise NotImplementedError
  11  
  12      def bullet_list(self, on):
  13 diff -urN formatter.orig/dom_xml.py formatter/dom_xml.py
  14 --- formatter.orig/dom_xml.py	2005-01-10 02:48:07.000000000 +0800
  15 +++ formatter/dom_xml.py	2005-11-27 15:44:26.000000000 +0800
  16 @@ -278,8 +278,8 @@
  17      def highlight(self, on):
  18          return self._set_tag('highlight', on)
  19  
  20 -    def number_list(self, on, type=None, start=None):
  21 -        return self._set_tag('ol', on, type=type, start=start)
  22 +    def number_list(self, on, type=None, start=None, style=None):
  23 +        return self._set_tag('ol', on, type=type, start=start, style=style)
  24  
  25      def bullet_list(self, on):
  26          return self._set_tag('ul', on)
  27 diff -urN formatter.orig/text_html.py formatter/text_html.py
  28 --- formatter.orig/text_html.py	2005-03-08 20:21:06.000000000 +0800
  29 +++ formatter/text_html.py	2005-11-27 16:43:42.000000000 +0800
  30 @@ -523,7 +523,7 @@
  31  
  32      # Lists ##############################################################
  33  
  34 -    def number_list(self, on, type=None, start=None):
  35 +    def number_list(self, on, type=None, start=None, style=None):
  36          tag = 'ol'
  37          if on:
  38              attr = {}
  39 @@ -531,6 +531,8 @@
  40                  attr['type'] = type
  41              if start is not None:
  42                  attr['start'] = start
  43 +            if style is not None:
  44 +                attr['style'] = style
  45              return self.open(tag, newline=1, attr=attr)
  46          return self.close(tag)
  47      
  48 @@ -581,7 +583,10 @@
  49          count_depth = max(depth - (self._base_depth - 1), 1)
  50  
  51          # check numbering, possibly changing the default
  52 -        if self._show_section_numbers is None:
  53 +	show_section_numbers = self._show_section_numbers	# default
  54 +        if kw.get('show_section_numbers',None) is not None:	# override
  55 +            show_section_numbers = kw['show_section_numbers']
  56 +        elif self._show_section_numbers is None:	# need to set default
  57              self._show_section_numbers = self.cfg.show_section_numbers
  58              numbering = self.request.getPragma('section-numbers', '').lower()
  59              if numbering in ['0', 'off']:
  60 @@ -591,6 +596,7 @@
  61              elif numbering in ['2', '3', '4', '5', '6']:
  62                  # explicit base level for section number display
  63                  self._show_section_numbers = int(numbering)
  64 +            show_section_numbers = self._show_section_numbers
  65  
  66          heading_depth = depth + 1
  67  
  68 @@ -600,13 +606,13 @@
  69              
  70          # create section number
  71          number = ''
  72 -        if self._show_section_numbers:
  73 +        if show_section_numbers:
  74              # count headings on all levels
  75              self.request._fmt_hd_counters = self.request._fmt_hd_counters[:count_depth]
  76              while len(self.request._fmt_hd_counters) < count_depth:
  77                  self.request._fmt_hd_counters.append(0)
  78              self.request._fmt_hd_counters[-1] = self.request._fmt_hd_counters[-1] + 1
  79 -            number = '.'.join(map(str, self.request._fmt_hd_counters[self._show_section_numbers-1:]))
  80 +            number = '.'.join(map(str, self.request._fmt_hd_counters[show_section_numbers-1:]))
  81              if number: number += ". "
  82  
  83          attr = {}
  84 diff -urN formatter.orig/text_plain.py formatter/text_plain.py
  85 --- formatter.orig/text_plain.py	2005-01-10 02:48:07.000000000 +0800
  86 +++ formatter/text_plain.py	2005-11-27 15:44:59.000000000 +0800
  87 @@ -90,7 +90,7 @@
  88      def highlight(self, on):
  89          return u''
  90  
  91 -    def number_list(self, on, type=None, start=None):
  92 +    def number_list(self, on, type=None, start=None, style=None):
  93          if on:
  94              self._in_list = 1
  95              return [u'\n', u'\n\n'][not self._did_para]

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] (2005-11-27 09:10:12, 4.0 KB) [[attachment:formatter.diff]]
 All files | Selected Files: delete move to page copy to page

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