Modify

Opened 11 years ago

Closed 11 years ago

#10718 closed enhancement (fixed)

[PATCH] make it working with Trac-1.0

Reported by: falkb Owned by: Ryan J Ollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords:
Cc: Steffen Hoffmann 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 11 years ago by Ryan J Ollos

Status: newassigned

comment:2 Changed 11 years ago by Ryan J Ollos

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

comment:3 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.