changeset 1182:5de0dc972701

removed deprecated usage of apply()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 14 Aug 2006 00:54:29 +0200
parents a7f8dceb4410
children bc84eae93f8c
files MoinMoin/formatter/dom_xml.py MoinMoin/formatter/text_gedit.py MoinMoin/formatter/text_html.py MoinMoin/formatter/text_plain.py MoinMoin/formatter/text_xml.py MoinMoin/macro/TableOfContents.py
diffstat 6 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/dom_xml.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/formatter/dom_xml.py	Mon Aug 14 00:54:29 2006 +0200
@@ -191,7 +191,7 @@
         return self._set_tag('lang', on, value=lang_name)
 
     def pagelink(self, on, pagename='', page=None, **kw):
-        apply(FormatterBase.pagelink, (self, pagename, page), kw)
+        FormatterBase.pagelink(self, pagename, page, **kw)
         if not pagename and page is not None:
             pagename = page.page_name
         kw['pagename'] = pagename
--- a/MoinMoin/formatter/text_gedit.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/formatter/text_gedit.py	Mon Aug 14 00:54:29 2006 +0200
@@ -40,7 +40,7 @@
 
             See wikiutil.link_tag() for possible keyword parameters.
         """
-        apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
+        FormatterBase.pagelink(self, on, pagename, page, **kw)
         if page is None:
             page = Page(self.request, pagename, formatter=self)
         return page.link_to(self.request, on=on, **kw)
--- a/MoinMoin/formatter/text_html.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/formatter/text_html.py	Mon Aug 14 00:54:29 2006 +0200
@@ -173,7 +173,7 @@
     indentspace = ' '
 
     def __init__(self, request, **kw):
-        apply(FormatterBase.__init__, (self, request), kw)
+        FormatterBase.__init__(self, request, **kw)
 
         # inline tags stack. When an inline tag is called, it goes into
         # the stack. When a block element starts, all inline tags in
@@ -484,7 +484,7 @@
 
             See wikiutil.link_tag() for possible keyword parameters.
         """
-        apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
+        FormatterBase.pagelink(self, on, pagename, page, **kw)
         if page is None:
             page = Page(self.request, pagename, formatter=self)
         if self.request.user.show_nonexist_qm and on and not page.exists():
@@ -510,9 +510,9 @@
                     wikitail, kw['anchor'] = wikitail.split('#', 1)
                 wikitail = wikiutil.url_unquote(wikitail)
                 try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions!
-                    return apply(self.pagelink, (on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail)), kw)
+                    return self.pagelink(on, wikiutil.AbsPageName(self.request, self.page.page_name, wikitail), **kw)
                 except:
-                    return apply(self.pagelink, (on, wikitail), kw)
+                    return self.pagelink(on, wikitail, **kw)
             else:
                 return self.pagelink(0)
         else: # return InterWiki hyperlink
--- a/MoinMoin/formatter/text_plain.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/formatter/text_plain.py	Mon Aug 14 00:54:29 2006 +0200
@@ -16,7 +16,7 @@
     hardspace = u' '
 
     def __init__(self, request, **kw):
-        apply(FormatterBase.__init__, (self, request), kw)
+        FormatterBase.__init__(self, request, **kw)
         self._in_code_area = 0
         self._in_code_line = 0
         self._code_area_state = [0, -1, -1, 0]
@@ -36,7 +36,7 @@
         return (u'\n\n*** ', u' ***\n\n')[not on]
 
     def pagelink(self, on, pagename='', page=None, **kw):
-        apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
+        FormatterBase.pagelink(self, on, pagename, page, **kw)
         return (u">>", u"<<") [not on]
 
     def interwikilink(self, on, interwiki='', pagename='', **kw):
--- a/MoinMoin/formatter/text_xml.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/formatter/text_xml.py	Mon Aug 14 00:54:29 2006 +0200
@@ -19,7 +19,7 @@
     hardspace = '&nbsp;'
 
     def __init__(self, request, **kw):
-        apply(FormatterBase.__init__, (self, request), kw)
+        FormatterBase.__init__(self, request, **kw)
         self._current_depth = 1
         self._base_depth = 0
         self.in_pre = 0
@@ -49,7 +49,7 @@
         return '<![CDATA[' + markup.replace(']]>', ']]>]]&gt;<![CDATA[') + ']]>'
 
     def pagelink(self, on, pagename='', page=None, **kw):
-        apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
+        FormatterBase.pagelink(self, on, pagename, page, **kw)
         if page is None:
             page = Page(self.request, pagename, formatter=self)
         return page.link_to(self.request, on=on, **kw)
@@ -202,7 +202,7 @@
         for key, value in kw.items():
             if key in valid_attrs:
                 attrs[key] = value
-        return apply(FormatterBase.image, (self,), attrs) + '</img>'
+        return FormatterBase.image(self, **attrs) + '</img>'
 
     def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
         return ('<codearea id="%s">' % code_id, '</codearea')[not on]
--- a/MoinMoin/macro/TableOfContents.py	Mon Aug 14 00:12:34 2006 +0200
+++ b/MoinMoin/macro/TableOfContents.py	Mon Aug 14 00:54:29 2006 +0200
@@ -67,7 +67,7 @@
         if self.include_macro is None:
             self.include_macro = wikiutil.importPlugin(self.macro.request.cfg,
                                                        'macro', "Include")
-        return self.pre_re.sub('', apply(self.include_macro, args, kwargs)).split('\n')
+        return self.pre_re.sub('', self.include_macro(*args, **kwargs)).split('\n')
 
     def run(self):
         _ = self._