Ticket #3596 (closed enhancement: fixed)

Opened 3 months ago

Last modified 3 months ago

NameError: global name 'format_to_html' is not defined

Reported by: mwehr Assigned to: coderanger
Priority: normal Component: NewsFlashMacro
Severity: normal Keywords:
Cc: jevans Trac Release: 0.11

Description

Hi

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

newflash.patch (467 bytes) - added by mwehr on 08/22/08 11:22:11.

Change History

08/22/08 11:22:11 changed by mwehr

  • attachment newflash.patch added.

08/23/08 02:50:33 changed by jevans

  • cc set to jevans.

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\formatter.py", 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\formatter.py", line 1055, in generate

escape_newlines)

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

self.handle_code_block(line)

File "c:\programs\python25\lib\site-packages\Trac-0.11.1-py2.5.egg\trac\wiki\formatter.py", 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\formatter.py", line 179, in process

text = self.processor(text)

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

text)

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

08/23/08 02:54:04 changed by coderanger

  • status changed from new to closed.
  • resolution set to fixed.

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

08/23/08 03:20:23 changed by jevans

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.

08/23/08 03:27:09 changed by jevans

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


Add/Change #3596 (NameError: global name 'format_to_html' is not defined)




Change Properties
Action