[Moin-devel] CVS: MoinMoin/formatter base.py,1.21,1.22 text_html.py,1.39,1.40 text_plain.py,1.17,1.18 text_xml.py,1.26,1.27
J?rgen Hermann
jhermann at users.sourceforge.net
Wed Apr 17 13:02:28 EDT 2002
Update of /cvsroot/moin/MoinMoin/formatter
In directory usw-pr-cvs1:/tmp/cvs-serv12084/MoinMoin/formatter
Modified Files:
base.py text_html.py text_plain.py text_xml.py
Log Message:
Passing request to formatters, short docs for macro interface
Index: base.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/formatter/base.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** base.py 20 Mar 2002 23:57:07 -0000 1.21
--- base.py 17 Apr 2002 19:54:35 -0000 1.22
***************
*** 26,30 ****
hardspace = ' '
! def __init__(self, **kw):
self._store_pagelinks = kw.get('store_pagelinks', 0)
self.pagelinks = []
--- 26,32 ----
hardspace = ' '
! def __init__(self, request, **kw):
! self.request = request
!
self._store_pagelinks = kw.get('store_pagelinks', 0)
self.pagelinks = []
Index: text_html.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/formatter/text_html.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** text_html.py 20 Mar 2002 23:57:07 -0000 1.39
--- text_html.py 17 Apr 2002 19:54:35 -0000 1.40
***************
*** 10,17 ****
# Imports
import cgi, string, sys, time
! from base import FormatterBase
from MoinMoin import wikiutil, config, user
from MoinMoin.Page import Page
- from MoinMoin.cgimain import request
from MoinMoin.i18n import _
--- 10,16 ----
# Imports
import cgi, string, sys, time
! from MoinMoin.formatter.base import FormatterBase
from MoinMoin import wikiutil, config, user
from MoinMoin.Page import Page
from MoinMoin.i18n import _
***************
*** 40,45 ****
! def __init__(self, **kw):
! apply(FormatterBase.__init__, (self,), kw)
self._in_li = 0
self._in_code = 0
--- 39,44 ----
! def __init__(self, request, **kw):
! apply(FormatterBase.__init__, (self, request), kw)
self._in_li = 0
self._in_code = 0
***************
*** 147,151 ****
if self._show_section_numbers is None:
self._show_section_numbers = config.show_section_numbers
! numbering = string.lower(request.getPragma('section-numbers', ''))
if numbering in ['0', 'off']:
self._show_section_numbers = 0
--- 146,150 ----
if self._show_section_numbers is None:
self._show_section_numbers = config.show_section_numbers
! numbering = string.lower(self.request.getPragma('section-numbers', ''))
if numbering in ['0', 'off']:
self._show_section_numbers = 0
***************
*** 157,165 ****
if self._show_section_numbers:
# count headings on all levels
! request._fmt_hd_counters = request._fmt_hd_counters[:depth]
! while len(request._fmt_hd_counters) < depth:
! request._fmt_hd_counters.append(0)
! request._fmt_hd_counters[-1] = request._fmt_hd_counters[-1] + 1
! number = string.join(map(str, request._fmt_hd_counters), ".") + " "
return '<H%d>%s%s%s</H%d>\n' % (
--- 156,164 ----
if self._show_section_numbers:
# count headings on all levels
! self.request._fmt_hd_counters = self.request._fmt_hd_counters[:depth]
! while len(self.request._fmt_hd_counters) < depth:
! self.request._fmt_hd_counters.append(0)
! self.request._fmt_hd_counters[-1] = self.request._fmt_hd_counters[-1] + 1
! number = string.join(map(str, self.request._fmt_hd_counters), ".") + " "
return '<H%d>%s%s%s</H%d>\n' % (
Index: text_plain.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/formatter/text_plain.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** text_plain.py 20 Mar 2002 23:57:07 -0000 1.17
--- text_plain.py 17 Apr 2002 19:54:35 -0000 1.18
***************
*** 10,14 ****
# Imports
import sys
! from base import FormatterBase
--- 10,14 ----
# Imports
import sys
! from MoinMoin.formatter.base import FormatterBase
***************
*** 24,29 ****
hardspace = ' '
! def __init__(self, **kw):
! apply(FormatterBase.__init__, (self,), kw)
def startDocument(self, pagename):
--- 24,29 ----
hardspace = ' '
! def __init__(self, request, **kw):
! apply(FormatterBase.__init__, (self, request), kw)
def startDocument(self, pagename):
Index: text_xml.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/formatter/text_xml.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** text_xml.py 20 Mar 2002 23:57:07 -0000 1.26
--- text_xml.py 17 Apr 2002 19:54:35 -0000 1.27
***************
*** 15,19 ****
from xml.sax import saxutils
! from base import FormatterBase
from MoinMoin import wikiutil
from MoinMoin.Page import Page
--- 15,19 ----
from xml.sax import saxutils
! from MoinMoin.formatter.base import FormatterBase
from MoinMoin import wikiutil
from MoinMoin.Page import Page
***************
*** 31,36 ****
hardspace = ' '
! def __init__(self, **kw):
! apply(FormatterBase.__init__, (self,), kw)
self._current_depth = 1
self._base_depth = 0
--- 31,36 ----
hardspace = ' '
! def __init__(self, request, **kw):
! apply(FormatterBase.__init__, (self, request), kw)
self._current_depth = 1
self._base_depth = 0
More information about the Moin-devel
mailing list