[Moin-user] SortBy.py macro broken in 1.7

Rick Vanderveer rick.vanderveer at gmail.com
Tue Jun 24 12:22:16 EDT 2008


Hello all,

So, I just upgraded to Moin 1.7 last night.  I thought I ran thru a battery
of tests of all the third-party macros I use on my test server, but
evidently missed one: the SortBy macro.  We use this to sort a phone number
table for our internal phone directory.  This macro worked perfectly in 1.6
(surviving the 1.5 to 1.6 upgrade unscathed), but there's some change in 1.7
that finally did it in.  I realize this is the third-party macro, but I'm
hoping the fix will be an easy one (hence, why I'm sending it to the list).
The error:


TypeError

send_page() takes exactly 1 non-keyword argument (2 given)

If you want to report a bug, please save this page and attach it to your bug
report.

   - Show debugging information
   - Report bug <http://moinmo.in/MoinMoinBugs>
   - Visit MoinMoin wiki <http://moinmo.in/FrontPage>

 Traceback

A problem occurred in a Python script. Here is the sequence of function
calls leading up to the error, in the order they occurred.

   1.

   d:\python25\Lib\site-packages\MoinMoin\request\__init__.py in
*run*(self=<MoinMoin.request.request_fcgi.Request object at
0x0091D250>)
   1. 1304 self.page.send_page()
      2. 1305 else:
      3. 1306 handler(self.page.page_name, self)
      4. 1307
      5. 1308 # every action that didn't use to raise MoinMoinFinish must
      call this now:
   - *handler* = <function do_show at 0x010A7130>
      - *self* = <MoinMoin.request.request_fcgi.Request object at
      0x0091D250>
      - self.*page* = <MoinMoin.Page.Page object at 0x0091D2B0>
      - self.page.*page_name* = u'PhoneList'
   2.

   d:\python25\Lib\site-packages\MoinMoin\action\__init__.py in
*do_show*(pagename=u'PhoneList',
request=<MoinMoin.request.request_fcgi.Request
   object at 0x0091D250>, content_only=0, count_hit=1, cacheable=1,
   print_mode=0)
   1. 251 count_hit=count_hit,
      2. 252 print_mode=print_mode,
      3. 253 content_only=content_only,
      4. 254 )
      5. 255
   - *content_only* = 0
   3.

   d:\python25\Lib\site-packages\MoinMoin\Page.py in
*send_page*(self=<MoinMoin.Page.Page object at 0x010C3FB0>,
**keywords={'content_only':
   0, 'count_hit': 1, 'print_mode': 0})
   1. 1195 format_args=pi['formatargs'],
      2. 1196 do_cache=do_cache,
      3. 1197 start_line=pi['lines'])
      4. 1198
      5. 1199 # check for pending footnotes
   - start_line *undefined*
      - *pi* = {'acl': <MoinMoin.security.AccessControlList instance at
      0x009186C0>, 'format': 'wiki', 'formatargs': '', 'language':
'en', 'lines':
      0}
   4.

   d:\python25\Lib\site-packages\MoinMoin\Page.py in
*send_page_content*(self=<MoinMoin.Page.Page object at 0x010C3FB0>,
   request=<MoinMoin.request.request_fcgi.Request object at 0x0091D250>,
   body=u"= The Cognitive Arts Phonelist =\n . ~-500 Davis ...es on this
   list, go to the PhoneListData page.''\n", format='wiki', format_args='',
   do_cache=1, **kw={'start_line': 0})
   1. 1283 try:
      2. 1284 code = self.loadCache(request)
      3. 1285 self.execute(request, parser, code)
      4. 1286 except Exception, e:
      5. 1287 if not is_cache_exception(e):
   - *self* = <MoinMoin.Page.Page object at 0x010C3FB0>
      - self.*execute* = <bound method Page.execute of <MoinMoin.Page.Page
      object at 0x010C3FB0>>
      - *request* = <MoinMoin.request.request_fcgi.Request object at
      0x0091D250>
      - *parser* = <MoinMoin.parser.text_moin_wiki.Parser instance at
      0x00918E40>
      - *code* = <code object <module> at 01109E30, file "PhoneList", line
      2>
   5.

   d:\python25\Lib\site-packages\MoinMoin\Page.py in
*execute*(self=<MoinMoin.Page.Page object at 0x010C3FB0>,
   request=<MoinMoin.request.request_fcgi.Request object at 0x0091D250>,
   parser=<MoinMoin.parser.text_moin_wiki.Parser instance at 0x00918E40>,
   code=<code object <module> at 01109E30, file "PhoneList", line 2>)
   1. 1314 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
      2. 1315 try:
      3. 1316 exec code
      4. 1317 except "CacheNeedsUpdate": # convert the exception
      5. 1318 raise Exception("CacheNeedsUpdate")
   - *code* = <code object <module> at 01109E30, file "PhoneList", line 2>
   6.

   d:\moin\PhoneList in ** ()
   7.

   d:\python25\Lib\site-packages\MoinMoin\formatter\__init__.py in
*macro*(self=<MoinMoin.formatter.text_html.Formatter instance at
0x00918968>,
   macro_obj=<MoinMoin.macro.Macro instance at 0x00918E18>, name=u'SortBy',
   args=u'PhoneListData,1,1,alpha',
   markup=u'<<SortBy(PhoneListData,1,1,alpha)>>')
   1. 312 # call the macro
      2. 313 try:
      3. 314 return macro_obj.execute(name, args)
      4. 315 except ImportError, err:
      5. 316 errmsg = unicode(err)
   - *macro_obj* = <MoinMoin.macro.Macro instance at 0x00918E18>
      - macro_obj.*execute* = <bound method Macro.execute of
      <MoinMoin.macro.Macro instance at 0x00918E18>>
      - *name* = u'SortBy'
      - *args* = u'PhoneListData,1,1,alpha'
   8.

   d:\python25\Lib\site-packages\MoinMoin\macro\__init__.py in
*execute*(self=<MoinMoin.macro.Macro instance at 0x00918E18>,
macro_name=u'SortBy',
   args=u'PhoneListData,1,1,alpha')
   1. 126 else:
      2. 127 raise ImportError("Cannot load macro %s" % macro_name)
      3. 128 return execute(self, args)
      4. 129
      5. 130 def _m_lang(self, text):
   - *execute* = <function execute at 0x00F3BC30>
      - *self* = <MoinMoin.macro.Macro instance at 0x00918E18>
      - *args* = u'PhoneListData,1,1,alpha'
   9.

   D:\Python25\lib\site-packages\MoinMoin\macro\SortBy.py in
*execute*(macro=<MoinMoin.macro.Macro instance at 0x00918E18>,
   args=u'PhoneListData,1,1,alpha')
   1. 428 sort_page, table, num_headers, sort_list = process_args(args,
      macro.request)
      2. 429 for sort_column, sort_type, reverse in sort_list:
      3. 430 sort_table(table, num_headers, sort_column, sort_type, reverse)

      4. 431 return format(sort_page, macro, table)
      5. 432 except SortByError, e: return error(e.msg, args)
   - *global* *format* = <function format at 0x00F3BBF0>
      - *sort_page* = <MoinMoin.Page.Page object at 0x0091D610>
      - *macro* = <MoinMoin.macro.Macro instance at 0x00918E18>
      - *table* = [['<tablewidth="750px"rowbgcolor="#f1f1f1">\'\'\'__Name__
      \'\'\' ', "'''__Email__''' ", "'''__Phone__''' ", "'''__Cell__''' "],
      ['Joe User ', ' juser at example.com ', '555-555-5555', '555-555-5555'],
      ['Joe Blow', ' jblow at example.com ', '555-555-5555', '555-555-5555'],
      ['...............this is sample data to protect privacy, but it gives you
      basic layout............ ' '], ...]
   10.

   D:\Python25\lib\site-packages\MoinMoin\macro\SortBy.py in
*format*(sort_page=<MoinMoin.Page.Page object at 0x0091D610>,
   macro=<MoinMoin.macro.Macro instance at 0x00918E18>,
   table=[['<tablewidth="750px"rowbgcolor="#f1f1f1">\'\'\'__Name__\'\'\' ',
   "'''__Email__''' ", "'''__Phone__''' ", "'''__Cell__''' "], ['1 boardroom ',
   ' ', '847-563-5001 ', ' '], ['2 west huddle room ', ' ', '847-425-8502 ', '
   '], ['3 south huddle room ', ' ', '847-563-5013 ', ' '], ['Joe User ', '
   juser at example.com ', '555-555-5555', '555-555-5555'], ['Joe Blow', '
   jblow at example.com ', '555-555-5555', '555-555-5555'],
   ['...............this is sample data to protect privacy, but it gives you
   basic layout............ '], ' '], ...])
   1. 402 stdout = sys.stdout
      2. 403 sys.stdout = StringIO.StringIO()
      3. 404 sort_page.send_page(macro.request, content_only=1)
      4. 405 ret += sys.stdout.getvalue()
      5. 406 sys.stdout = stdout
   - *sort_page* = <MoinMoin.Page.Page object at 0x0091D610>
      - sort_page.*send_page* = <bound method Page.send_page of
      <MoinMoin.Page.Page object at 0x0091D610>>
      - *macro* = <MoinMoin.macro.Macro instance at 0x00918E18>
      - macro.*request* = <MoinMoin.request.request_fcgi.Request object at
      0x0091D250>
      - content_only *undefined*

TypeError

send_page() takes exactly 1 non-keyword argument (2 given)

   - args = ('send_page() takes exactly 1 non-keyword argument (2 given)',)
   - message = 'send_page() takes exactly 1 non-keyword argument (2 given)'

 System Details

   - Date: Tue, 24 Jun 2008 15:48:56 +0000
   - Platform: win32 (nt)
   - Python: Python 2.5.1 (D:\Python25\python.exe)
   - MoinMoin: Release 1.7.0 (release)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20080624/56996ffb/attachment.html>


More information about the Moin-user mailing list