wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

tal:repeat does not support multiple assignment #33

Closed iksteen closed 10 years ago

iksteen commented 10 years ago

Chameleon supports multiple assignment when performing iteration:

<li tal:repeat="(ix, item) items"></li>

However, in the xml extractor, value is split by the first whitespace character which means that value will contain item) items:

elif attribute[1] == 'repeat':
    (engine, value) = get_tales_engine(value.split(None, 1)[1])

And pot-create will fail:

Aborting due to Python syntax error in %s[%d]: %s ./portal/templates/sidebar.pt 7 item) items

Removing the space after the comma can function as a workaround.