Modify

Opened 16 years ago

Closed 14 years ago

#3556 closed defect (worksforme)

Usage of tf.form_updater or tf.form_updated unclear - syntax error raised

Reported by: anonymous Owned by: Steffen Hoffmann
Priority: normal Component: TracFormsPlugin
Severity: normal Keywords: macro processor documentation
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

when using either of those, the following error is returned:

TypeError: expected string or buffer

version 2.1 of the plugin

'''Trac''':  	0.11stable-r7384
'''Python''': 	2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
'''setuptools''': 	0.6c8
'''SQLite''': 	3.5.2
'''pysqlite''': 	2.4.0
'''Genshi''': 	0.5
'''mod_python''': 	3.3.1
'''Pygments''': 	0.10
'''Subversion''': 	1.5.0 (r31699)
'''jQuery''':	1.2.6

with the following traceback:

File "E:\Engineering\bin\Python25\lib\site-packages\trac-0.11stable_r7384-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 "e:\engineering\bin\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 1095, in format_to_html
  return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
File "e:\engineering\bin\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 1054, in generate
  escape_newlines)
File "e:\engineering\bin\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 833, in format
  self.handle_code_block(line)
File "e:\engineering\bin\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 764, in handle_code_block
  processed = self.code_processor.process(code_text)
File "e:\engineering\bin\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 179, in process
  text = self.processor(text)
File "pathto\python25\lib\site-packages\Trac-0.11stable_r7384-py2.5.egg\trac\wiki\formatter.py", line 166, in _macro_processor
  text)
File "build\bdist.win32\egg\tracforms\macros.py", line 29, in expand_macroFile "build\bdist.win32\egg\tracforms\macros.py", line 127, in executeFile "build\bdist.win32\egg\tracforms\macros.py", line 351, in processFile "build\bdist.win32\egg\tracforms\macros.py", line 180, in getargs

Attachments (0)

Change History (4)

comment:1 Changed 14 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 14 years ago by Steffen Hoffmann

Keywords: macro processor syntax error added
Owner: changed from Rich Harkins to Steffen Hoffmann

Me too, so this is either not working since a long time (or since initial implementation?), or both of us are equally dumb to not understand how to properly use it.

Any news from your side? At least to me it looks like it's expecting an argument and bailing out after not finding one. Would be great to join for this research.

comment:3 in reply to:  2 Changed 14 years ago by Steffen Hoffmann

Keywords: documentation added; syntax error removed
Summary: usage of tf.form_updater or tf.form_updated on errorsUsage of tf.form_updater or tf.form_updated unclear - syntax error raised

Replying to hasienda:

Me too, so this is either not working since a long time (or since initial implementation?), or both of us are equally dumb to not understand how to properly use it.

Sadly it turned out to be option 2 - too dumb to follow the docs. In fact, if you strictly follow the documented syntax, it works instantly.

Remember, that a operation:argument syntax is expected. The problem arises, because this is non-intuitive for this operations. Anyway, following code has been tested successfully:

[tf.form_updater:] [tf.form_updated_on:%c]

Note: The strftime format string is optional, while the colon is not!

I'll close this issue after adding the aforementioned example in the documentation for extra clarity.

comment:4 Changed 14 years ago by Steffen Hoffmann

Resolution: worksforme
Status: newclosed

See the example in our new tutorial section.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
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.