-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09.10.2012 09:17, Adelphe Rafanambinana wrote:
> I check log file and I saw IndentationError. I was able to fix it, and
> got the plugin loaded.
> When I changed/created ticket, I got this error in TRAC:
>     NameError: global name 'script' is not defined
>  
> Then I added
>     global script
>  
> before this line in MyTicketChangeScriptCaller.py file:
>     script = Option('ticket_change_script', 'call', '',
>     doc="/usr/local/bin/test.sh") 
>  
> Then I got this error:
>     TypeError: sequence item 0: expected string, Option found
> Any idea how to fix it?

Seems like good progress so far.

Sure, this is just about python classes. And no need for 'global' here.

The Option declaration in the beginning of the class declaration makes
all defined variables available in the classes context, so you need to call
 script

as
 self.script

in any class method.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlB0YPUACgkQ31DJeiZFuHdZzQCguItfkYtnakTzDEaBTbc3I1JM
/ycAn1IqA0EN1RNjgkUE/hNPlc5bY3s2
=ozfm
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to