Changeset 2769
- Timestamp:
- 11/11/07 14:40:11 (1 year ago)
- Files:
-
- ticketboxmacro/0.11/TicketBox.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ticketboxmacro/0.11/TicketBox.py
r2768 r2769 58 58 return "'%s'" % x.replace( "'","''" ) 59 59 60 def execute(hdf, txt, env): 60 def execute(formatter, args): 61 txt = args 62 req = formatter.req 63 env = formatter.env 61 64 if not txt: 62 65 txt = '' … … 82 85 # username, do not override if specified 83 86 if not dv.has_key('USER'): 84 dv['USER'] = hdf.getValue('trac.authname', 'anonymous')87 dv['USER'] = req.authname 85 88 if match.group('dv'): 86 89 for expr in string.split(match.group('dv')[1:], '&'): … … 114 117 items.sort() 115 118 html = '' 116 try: 117 # for trac 0.9 or later 118 from trac.wiki.formatter import wiki_to_oneliner 119 html = wiki_to_oneliner(string.join(["#%d" % c for c in items], ", "), 120 env, env.get_db_cnx()) 121 except: 122 # for trac 0.8.x 123 from trac.WikiFormatter import wiki_to_oneliner 124 html = wiki_to_oneliner(string.join(["#%d" % c for c in items], ", "), 125 hdf, env, env.get_db_cnx()) 119 from trac.wiki.formatter import wiki_to_oneliner, wiki_to_outline 120 html = wiki_to_oneliner(string.join(["#%d" % c for c in items], ", "), 121 env, env.get_db_cnx(), req=formatter.req) 126 122 if html != '': 127 123 try: … … 135 131 return '' 136 132 137 # trac version 0.11 and up compatibility138 133 139 134 from trac.wiki.macros import WikiMacroBase … … 150 145 [[HelloWorld]]), then `args` is `None`. 151 146 """ 152 return execute(formatter .req.hdf, args, formatter.env)147 return execute(formatter, args)
