format not defined

25 views
Skip to first unread message

Jon Drukman

unread,
Feb 2, 2012, 2:10:52 PM2/2/12
to trac-...@googlegroups.com
I am trying to customize my email ticket template as documented at

In particular, I copied the paragraph that replaces the ascii table of properties with the one-line-per-property format for HTML mail readers.  However, after saving and restarting trac, I now get this error whenever I try to update a ticket:

Warning: The change has been saved, but an error occurred while sending notifications: "format" not defined

It is complaining about this line:

${'\n'.join('%s\t%s' % (format(p[0]+':', ' <12'), p[1]) for p in pv if p[0] in sel)}

I copied it straight out of the wiki and I don't know squat about Python so I'm not sure how to fix it.  Help please!
-jsd-

Mikael Relbe

unread,
Feb 2, 2012, 2:41:56 PM2/2/12
to trac-...@googlegroups.com

I’m the one who wrote those lines on the wiki page

http://trac.edgewall.org/wiki/TracNotification#Customizinge-mailcontentforMSOutlook

 

“format” is an built-in function in Python... weird.

What versions of Python, Trac and Genshi are you using?

Can you provide an error log with more details?

 

/Mikael

 

 

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/6AqVAmZ3-TkJ.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to
trac-users+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.

Jon Drukman

unread,
Feb 2, 2012, 5:13:21 PM2/2/12
to trac-...@googlegroups.com
Python 2.4.3
Trac 0.12
I don't know how to find out the Genshi version - if you tell me, I will look it up.

Here's the log file:

2012-02-02 14:11:56,089 Trac[main] DEBUG: Dispatching <Request "POST '/ticket/16090'">
2012-02-02 14:11:56,092 Trac[api] INFO: Synchronized '' repository in 0.00 seconds
2012-02-02 14:11:56,093 Trac[session] DEBUG: Retrieving session for ID 'jsd'
2012-02-02 14:11:56,158 Trac[web_ui] ERROR: Failure sending notification on change to ticket #16090: UndefinedError: "format" not defined
2012-02-02 14:11:56,158 Trac[chrome] DEBUG: Prepare chrome data for request
2012-02-02 14:11:56,162 Trac[web_ui] DEBUG: Side effect for ConfigurableTicketWorkflow

Remy Blank

unread,
Feb 2, 2012, 5:33:03 PM2/2/12
to trac-...@googlegroups.com
Jon Drukman wrote:
> Python 2.4.3

format() was introduced in 2.6. You should probably use the % operator
instead (and make the relevant changes to the format string).

-- Remy

signature.asc

Jon Drukman

unread,
Feb 2, 2012, 5:49:47 PM2/2/12
to trac-...@googlegroups.com
Sorry, as I said, I know nothing about Python.  Can you write it out for me?  :)
Reply all
Reply to author
Forward
0 new messages