Modify

#10718 closed enhancement (fixed)

[PATCH] make it working with Trac-1.0

Reported by: falkb Owned by: rjollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords:
Cc: hasienda Trac Release: 1.0

Description

Trying today's SVN revision of this plugin I noticed it doesn't work with Trac 1.0, just strange errors like "... macro ... no longer supported ..." appear as desribed here.

I was able to fix it for me with the hint of hasienda. It works for me now on Trac-1.0.0. Here are my 2 little patches:

  • wikitablemacro/0.11/wikitable/table.py

     
    3333     
    3434    # Render macro 
    3535     
    36     def render_macro(self, req, name, content): 
     36    def expand_macro(self, formatter, name, content): 
    3737        db = self.env.get_db_cnx() 
    3838        cursor = db.cursor() 
    3939        cursor.execute(content) 
     40 
     41        req = formatter.req 
    4042         
    4143        out = StringIO() 
  • wikitablemacro/0.11/wikitable/scalar.py

     
    2323     
    2424    # Render macro 
    2525     
    26     def render_macro(self, req, name, content): 
     26    def expand_macro(self, formatter, name, content): 
    2727        db = self.env.get_db_cnx() 
    2828        cursor = db.cursor() 
    2929        cursor.execute(content) 
     
    3636    out = StringIO()  
    3737    print >>out, u"<span class='wikiscalar'>%s</span>" % value 
    3838 
    39         add_stylesheet(req, 'wikitable/css/wikitable.css') 
     39        add_stylesheet(formatter.req, 'wikitable/css/wikitable.css') 
    4040        return Markup(out.getvalue()) 

Attachments (0)

Change History (3)

comment:1 Changed 19 months ago by rjollos

  • Status changed from new to assigned

comment:2 Changed 19 months ago by rjollos

The patch looks great. I will commit it after I get some sleep :)

comment:3 Changed 19 months ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [12455]) Fixes #10718 (0.2dev): Use Trac 0.11+ API, replacing implementation of render_macro with expand_macro.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.