Re: [Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-14 Thread Gautam Saha
Andrew Milton wrote:
+---[ Gautam Saha ]--
| Hi:
| 
| I am getting a METALError when I try to do use-macro in ZPT.
| 
| Here is my code  in main_template.pt
| .
| ..

[snip]
|  
|  
| 
| 
| 

[snip]
| I am basically returning  'here/subtab/macros/tools_sub' from the 
| getSubTab() py
| script. ( my script has one line for testing - return  
| 'here/subtab/macros/tools_sub'
| 
| Any help to resolve this is greatly appreciated.

You actually have to return a macro, not a string representing the path to the
macro. Your script will have to return here.subtab.macros['tools_sub']
I think that's the right format.
 

Thanks a lot for your help.  My return now looks like:
return context.subtab.macros['tools_sub']
GS
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Andrew Milton
+---[ Gautam Saha ]--
| Hi:
| 
| I am getting a METALError when I try to do use-macro in ZPT.
| 
| Here is my code  in main_template.pt
| .
| ..

[snip]

|  
|  
| 
| 
| 

[snip]

| I am basically returning  'here/subtab/macros/tools_sub' from the 
| getSubTab() py
| script. ( my script has one line for testing - return  
| 'here/subtab/macros/tools_sub'
| 
| Any help to resolve this is greatly appreciated.

You actually have to return a macro, not a string representing the path to the
macro. Your script will have to return here.subtab.macros['tools_sub']
I think that's the right format.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Gautam Saha
Hi:
I am getting a METALError when I try to do use-macro in ZPT.
Here is my code  in main_template.pt
.
..
 
 
 
 


The first  use-macro works (as I put the full macro path), But the 2nd 
call does not work
and giving the error.
I am basically returning  'here/subtab/macros/tools_sub' from the 
getSubTab() py
script. ( my script has one line for testing - return  
'here/subtab/macros/tools_sub'

Any help to resolve this is greatly appreciated.
Thanks,
Gautam
---
Zope/Plone spec:
Zope Version: (Zope 2.7.3-0, python 2.3.4, freebsd5)
Python Version: 2.3.4 (#2, Oct 21 2004, 17:49:27) [GCC 3.3.3 [FreeBSD] 
20031106]
Plone 2.0.4

===
Site Error
An error was encountered while publishing this resource.
METALError
Sorry, a site error occurred.
Traceback (innermost last):
   * Module ZPublisher.Publish, line 175, in publish_module_standard
   * Module Products.PlacelessTranslationService.PatchStringIO, line 
51, in new_publish
   * Module ZPublisher.Publish, line 132, in publish
   * Module Zope.App.startup, line 204, in zpublisher_exception_hook
   * Module ZPublisher.Publish, line 101, in publish
   * Module ZPublisher.mapply, line 88, in mapply
   * Module ZPublisher.Publish, line 39, in call_object
   * Module Products.CMFCore.PortalContent, line 116, in __call__
   * Module Shared.DC.Scripts.Bindings, line 306, in __call__
   * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   * Module Products.CMFCore.FSPageTemplate, line 191, in _exec
   * Module Products.CMFCore.FSPageTemplate, line 124, in pt_render
   * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
 
   * Module TAL.TALInterpreter, line 190, in __call__
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 664, in do_useMacro

METALError: macro 'python:here.getSubTab()' has incompatible version 
None, at line 88, column 4 (Also, an error occurred while attempting to 
render the standard error message.)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )