Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3596 closed enhancement (fixed)

NameError: global name 'format_to_html' is not defined

Reported by: Mario Owned by: Noah Kantrowitz
Priority: normal Component: NewsFlashMacro
Severity: normal Keywords:
Cc: J Evan S Trac Release: 0.11



I'm using the latest 0.11 branch. I'm getting "NameError: global name 'format_to_html' is not defined" error.

looks like you missed to import it :-)

The attached patch works for me.

greetings Mario

Attachments (1)

newflash.patch (467 bytes) - added by Mario 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Mario

Attachment: newflash.patch added

comment:1 Changed 10 years ago by J Evan S

Cc: J Evan S added; anonymous removed

I'm having trouble getting this to work. Got the same error. Checked out the source, made the patch change, deleted the previous egg file, and tried to install again. Now I also get a traceback on the web page when I insert a test newsflash. What am I missing?

File "C:\Programs\Python25\lib\site-packages\trac-0.11.1-py2.5.egg\trac\wiki\templates\wiki_edit.html", line 56, in <Expression u'wiki_to_html(context(page.resource), page.text)'>

${wiki_to_html(context(page.resource), page.text)}

File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 1096, in format_to_html

return HtmlFormatter(env, context, wikidom).generate(escape_newlines)

File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 1055, in generate


File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 833, in format


File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 764, in handle_code_block

processed = self.code_processor.process(code_text)

File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 179, in process

text = self.processor(text)

File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\", line 166, in _macro_processor


File "build\bdist.win32\egg\newsflash\", line 25, in expand_macro

comment:2 Changed 10 years ago by Noah Kantrowitz

Resolution: fixed
Status: newclosed

(In [4175]) Change the import. (closes #3596)

comment:3 Changed 10 years ago by J Evan S

I tried the easy_install -m option to uninstall and deleted the egg before re-installing. Is that correct? I'm still getting the same error.

comment:4 Changed 10 years ago by J Evan S

Okay, little thing like restarting tracd did wonders...

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.