changeset 5258:d4331ca5c218

kill macro.form, please use macro.request.{args,form,values} (plus fixes for some macros)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 07 Nov 2009 19:18:28 +0100
parents c85a99b5d78f
children 5b3c8d341dfa
files MoinMoin/macro/FullSearch.py MoinMoin/macro/MonthCalendar.py MoinMoin/macro/TeudView.py MoinMoin/macro/__init__.py
diffstat 4 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/FullSearch.py	Sat Nov 07 18:33:53 2009 +0100
+++ b/MoinMoin/macro/FullSearch.py	Sat Nov 07 19:18:28 2009 +0100
@@ -42,8 +42,8 @@
     @return: search box html fragment
     """
     _ = macro._
-    if 'value' in macro.form:
-        default = wikiutil.escape(macro.form["value"], quote=1)
+    if 'value' in macro.request.values:
+        default = wikiutil.escape(macro.request.values["value"], quote=1)
     else:
         default = ''
 
--- a/MoinMoin/macro/MonthCalendar.py	Sat Nov 07 18:33:53 2009 +0100
+++ b/MoinMoin/macro/MonthCalendar.py	Sat Nov 07 19:18:28 2009 +0100
@@ -6,7 +6,7 @@
     The days are links to Wiki pages following this naming convention:
     BasePageName/year-month-day
 
-    @copyright: 2002-2008 MoinMoin:ThomasWaldmann
+    @copyright: 2002-2009 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 
     Revisions:
@@ -215,9 +215,9 @@
     currentyear, currentmonth, currentday, h, m, s, wd, yd, ds = request.user.getTime(time.time())
     thispage = formatter.page.page_name
     # does the url have calendar params (= somebody has clicked on prev/next links in calendar) ?
-    if 'calparms' in macro.form:
+    if 'calparms' in macro.request.args:
         has_calparms = 1 # yes!
-        text2 = macro.form['calparms']
+        text2 = macro.request.args['calparms']
         cparmpagename, cparmyear, cparmmonth, cparmoffset, cparmoffset2, cparmheight6, cparmanniversary, cparmtemplate = \
             parseargs(request, text2, thispage, currentyear, currentmonth, 0, 0, False, False, u'')
         # Note: cparmheight6 and cparmanniversary are not used, they are just there
--- a/MoinMoin/macro/TeudView.py	Sat Nov 07 18:33:53 2009 +0100
+++ b/MoinMoin/macro/TeudView.py	Sat Nov 07 19:18:28 2009 +0100
@@ -33,8 +33,8 @@
     xslfile = xmldoc.getDataPath('webde.xsl')
     pagename = macro.formatter.page.page_name
 
-    if 'module' in macro.form:
-        modname = macro.form["module"]
+    if 'module' in macro.request.args:
+        modname = macro.request.args["module"]
         try:
             obj = pydoc.locate(modname)
         except pydoc.ErrorDuringImport, value:
--- a/MoinMoin/macro/__init__.py	Sat Nov 07 18:33:53 2009 +0100
+++ b/MoinMoin/macro/__init__.py	Sat Nov 07 19:18:28 2009 +0100
@@ -6,13 +6,10 @@
     and/or dynamic page content.
 
     The canonical interface to plugin macros is their execute() function,
-    which gets passed an instance of the Macro class. Such an instance
-    has the four members parser, formatter, form and request.
-
-    Using "form" directly is deprecated and should be replaced by "request.form".
+    which gets passed an instance of the Macro class.
 
     @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
-                2006-2007 MoinMoin:ThomasWaldmann,
+                2006-2009 MoinMoin:ThomasWaldmann,
                 2007 MoinMoin:JohannesBerg
     @license: GNU GPL, see COPYING for details.
 """
@@ -86,7 +83,7 @@
 
     def __init__(self, parser):
         self.parser = parser
-        self.form = self.parser.form
+        #self.form --> gone, please use self.request.{form,args,values}
         self.request = self.parser.request
         self.formatter = self.request.formatter
         self._ = self.request.getText