Ticket #1807 (reopened defect)

Opened 1 year ago

Last modified 5 months ago

'MediaWikiRenderer' object has no attribute 'render_macro'

Reported by: hornsby.3@rf.ohio-state.edu Assigned to: permon
Priority: normal Component: MediaWikiPluginMacro
Severity: blocker Keywords:
Cc: ray.30@rf.ohio-state.edu Trac Release: 0.9

Description

After adding the demo code to a page, python can't find something it needs

Python Traceback

Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/var/lib/python-support/python2.4/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/var/lib/python-support/python2.4/trac/wiki/web_ui.py", line 135, in process_request
    self._render_view(req, db, page)
  File "/var/lib/python-support/python2.4/trac/wiki/web_ui.py", line 443, in _render_view
    req.hdf['wiki'] = {
  File "/var/lib/python-support/python2.4/trac/wiki/formatter.py", line 999, in wiki_to_html
    Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)
  File "/var/lib/python-support/python2.4/trac/wiki/formatter.py", line 793, in format
    self.handle_code_block(line)
  File "/var/lib/python-support/python2.4/trac/wiki/formatter.py", line 732, in handle_code_block
    self.out.write(to_unicode(self.code_processor.process(
  File "/var/lib/python-support/python2.4/trac/wiki/formatter.py", line 112, in process
    text = self.processor(req, text)
  File "/var/lib/python-support/python2.4/trac/wiki/formatter.py", line 100, in _macro_processor
    return self.macro_provider.render_macro(req, self.name, text)
AttributeError: 'MediaWikiRenderer' object has no attribute 'render_macro'

I think the plugin is installed correctly: # easy_install http://trac-hacks.org/svn/mediawikipluginmacro

And if I comment out the mediawiki.* = enabled part of the trac.ini, trac says that it doesn't know what to do with the mediawiki directive when loading the page, which makes sense.

Is there a specific dependency that this plugin relies on?

Attachments

Change History

07/17/07 08:26:44 changed by hornsby.3@rf.ohio-state.edu

  • cc set to ray.30@rf.ohio-state.edu.

07/18/07 06:58:23 changed by permon

  • status changed from new to closed.
  • resolution set to fixed.

render_macro is old way of plugin interfacing and should be deprecated in new ones. But I've just added it (in r2483)as an alias for expand_macro. Macro has worked with current trunk. Now should be working with older versions. There are no dependencies.

07/19/07 08:25:30 changed by hornsby.3@rf.ohio-state.edu

That worked, thanks!

05/09/08 10:32:12 changed by Michael Breuer

  • release changed from 0.10 to 0.9.
  • status changed from closed to reopened.
  • resolution deleted.

I just tried to use the example wiki page

(http://trac-hacks.org/wiki/MediaWikiPluginMacro)

and get

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler

dispatch_request(mpr.path_info, mpr, env)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 107, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 116, in process_request

self._render_view(req, db, page)

File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 364, in _render_view

req.hdfwiki.page_html? = wiki_to_html(page.text, self.env, req)

File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 751, in wiki_to_html

Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)

File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 577, in format

self.handle_code_block(line)

File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 547, in handle_code_block

self.out.write(self.code_processor.process(self.req, self.code_text))

File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 109, in process

text = self.processor(req, text)

File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 99, in _macro_processor

return macro_provider.render_macro(req, self.name, text)

File "/usr/lib/python2.4/site-packages/trac/core.py", line 165, in getattr

raise AttributeError?, "'%s' object has no attribute '%s'" % (cls, name)

AttributeError?: 'mediawiki.parser.MediaWikiRenderer?' object has no attribute 'render_macro'

I examined my mediawiki.py and its the same as in r2483.

Are there other thinks to be careful ?

05/09/08 10:33:37 changed by Michael.Breuer@cosens.de

Please let me know if you need more information


Add/Change #1807 ('MediaWikiRenderer' object has no attribute 'render_macro')




Change Properties
Action