On Wed, Dec 9, 2009 at 22:08, Josh Eastburn <jkeastburn+xw...@gmail.com> wrote:
> Thomas,
>
> So far, no luck.
>
> I tried a simple script like:
>
> {{python}}
> try:
>    print xcontext.action
> except Exception:
>    print 'exception'
> {{/python}}
>
> this outputs:
>
> exception
>
> Side note:
>
> {{python}}
> try:
>    print xcontext.action
> except Exception as exc:
>    print exc
> {{/python}}
>
> Results in a failure to execute the macro.

Indeed it seems there is a bug in Jython JSR 223 implementation. I'm
looking at it and will report the issue to jython if i can validate
that it comes from jython.

>
> -Josh
>
> On Wed, Dec 9, 2009 at 4:17 AM, Thomas Mortagne <thomas.morta...@xwiki.com>
> wrote:
>>
>> Hi,
>>
>> On Wed, Dec 9, 2009 at 02:50, Josh Eastburn 
>> <jkeastburn+xw...@gmail.com<jkeastburn%2bxw...@gmail.com>>
> wrote:
>> > The documentation seems to indicate that bindings normally available in
>> > Velocity like $context should be available in other scripting languages,
> but
>> > accessing 'context' in Python (e.g. if context.action == 'inline':)
> always
>> > gives me problems. Any help?
>>
>> "context" is deprecated and contains JSR223 ScriptContext (it's a
>> reserved keyword). You need to use "xcontext".
>>
>> >
>> > Thanks,
>> >
>> > Josh
>> > _______________________________________________
>> > users mailing list
>> > users@xwiki.org
>> > http://lists.xwiki.org/mailman/listinfo/users
>> >
>>
>>
>>
>> --
>> Thomas Mortagne
>> _______________________________________________
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Thomas Mortagne
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to