Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules expressions only have already imported modules #34

Closed
rpatterson opened this issue Aug 1, 2011 · 3 comments
Closed

modules expressions only have already imported modules #34

rpatterson opened this issue Aug 1, 2011 · 3 comments

Comments

@rpatterson
Copy link

The modules available in TAL expressions only contain already imported modules while the reference implementation will import modules that aren't yet in sys.modules. Here's the TB I get under Chameleon that I don't get without::

KeyError: 'webcouturier.dropdownmenu.utils'

 - Expression: "python:modules['webcouturier.dropdownmenu.utils']"
 - Filename:   .../src/webcouturier.dropdownmenu/webcouturier/dropdownmenu/browser/dropdown_recurse.pt
 - Location:   (9:22)

 - Source:     ... e="utils python:modules['webcouturier.dropdownmenu.utils'];
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               context: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               views: <ViewMapper - at 0xe326ecc>
               modules: <instance - at 0xa50feec>
               bottomLevel: 0
               args: <tuple - at 0xb77ea02cL>
               here: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               user: <ImplicitAcquisitionWrapper - at 0xe6b1a7c>
               nothing: <NoneType - at 0x81904d8>
               children: <list - at 0xf0b7acc>
               traverse_subpath: <list - at 0xe504f2c>
               convert: <function translate at 0xf28172c>
               container: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               normalizeString: <instancemethod normalizeString at 0xf2ee5cc>
               level: 1
               default: <object - at 0xb78096f0L>
               request: <instance - at 0xe849bac>
               wrapped_repeat: <SafeMapping - at 0xf2ee194>
               decode: <function decode at 0xf28164c>
               template: <ViewPageTemplateFile - at 0xcf2114c>
               translate: <function translate at 0xf28172c>
               root: <ImplicitAcquisitionWrapper Zope at 0xce4beb4>
               options: {...} (3)
               loop: {...} (0)
               view: <DropdownMenuViewlet plone.global_sections at 0xe87a2cc>

 - Expression: "python:view.getTabObject(tabUrl = tab['url'], tabPath = tab.get('path'))"
 - Filename:   .../src/webcouturier.dropdownmenu/webcouturier/dropdownmenu/browser/dropdown_sections.pt
 - Location:   (9:43)

 - Source:     ... python:view.getTabObject(tabUrl = tab['url'], tabPath = tab.get('path')) ...
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               context: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               views: <ViewMapper - at 0xd46af4c>
               modules: <instance - at 0xa50feec>
               args: <tuple - at 0xb77ea02cL>
               here: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               user: <ImplicitAcquisitionWrapper - at 0xe6b1a7c>
               tab: {...} (4)
               nothing: <NoneType - at 0x81904d8>
               traverse_subpath: <list - at 0xe9aa44c>
               convert: <function translate at 0xf2818ec>
               container: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               default: <object - at 0xb78096f0L>
               request: <instance - at 0xe849bac>
               wrapped_repeat: <SafeMapping - at 0xf27ed24>
               decode: <function decode at 0xf281924>
               template: <ViewPageTemplateFile - at 0xcf2110c>
               view: <DropdownMenuViewlet plone.global_sections at 0xe87a2cc>
               translate: <function translate at 0xf2818ec>
               root: <ImplicitAcquisitionWrapper Zope at 0xce4beb4>
               options: {...} (0)
               loop: {...} (1)
               attrs: {...} (1)

 - Expression: "provider:plone.portalheader"
 - Filename:   /usr/local/lib/python/site-packages/plone.app.layout-2.1.8-py2.7.egg/plone/app/layout/viewlets/portal_header.pt
 - Location:   (2:32)

 - Source:     ... :replace="structure provider:plone.portalheader" />
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               context: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               views: <ViewMapper - at 0xea2c6ac>
               modules: <instance - at 0xa50feec>
               args: <tuple - at 0xb77ea02cL>
               here: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               user: <ImplicitAcquisitionWrapper - at 0xe6b1a7c>
               nothing: <NoneType - at 0x81904d8>
               traverse_subpath: <list - at 0xe2c934c>
               convert: <function translate at 0xf473df4>
               container: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               default: <Placeholder - at 0xd80984c>
               request: <instance - at 0xe849bac>
               wrapped_repeat: <SafeMapping - at 0xf040e3c>
               decode: <function decode at 0xf473e2c>
               template: <ViewPageTemplateFile - at 0xcb4152c>
               view: <SimpleViewletClass from /usr/local/lib/python/site-packages/plone.app.layout-2.1.8-py2.7.egg/plone/app/layout/viewlets/portal_header.pt plone.header at 0xe9ae86c>
               translate: <function translate at 0xf473df4>
               root: <ImplicitAcquisitionWrapper Zope at 0xce4beb4>
               options: {...} (0)
               loop: {...} (0)
               attrs: {...} (1)

 - Expression: "provider:plone.portaltop"
 - Filename:   <string>
 - Location:   (68:40)
 - Arguments:  repeat: {...} (0)
               template: <ImplicitAcquisitionWrapper folder_listing at 0xe309824>
               modules: <instance - at 0xa50feec>
               here: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               user: <ImplicitAcquisitionWrapper - at 0xe6b1a7c>
               nothing: <NoneType - at 0x81904d8>
               traverse_subpath: <list - at 0xea290ac>
               convert: <function translate at 0xf28d844>
               container: <ImplicitAcquisitionWrapper plone at 0xf268644>
               default: <object - at 0xb78096f0L>
               request: <instance - at 0xe849bac>
               wrapped_repeat: <SafeMapping - at 0xe6b1f04>
               decode: <function decode at 0xf28de64>
               context: <ImplicitAcquisitionWrapper departments at 0xf2685a4>
               translate: <function translate at 0xf28d844>
               root: <ImplicitAcquisitionWrapper Zope at 0xce4beb4>
               options: {...} (1)
               loop: {...} (0)

For example, this works fine under chameleon if I just do "import webcouturier.dropdownmenu.utils" sometime before the template is rendered.

@malthe
Copy link
Owner

malthe commented Aug 1, 2011

Fixed in five.pt trunk (requires currently unreleased Chameleon > 2.2).

Thanks!

@malthe malthe closed this as completed Aug 1, 2011
@rpatterson
Copy link
Author

I have the latest chameleon from git and it's version is at 2.2 so buildout fails. Can you increment the version?

@malthe
Copy link
Owner

malthe commented Aug 2, 2011

Done.

On 2 August 2011 04:38, rpatterson
reply@reply.github.com
wrote:

I have the latest chameleon from git and it's version is at 2.2 so buildout fails.  Can you increment the version?

Reply to this email directly or view it on GitHub:
#34 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants