-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09.10.2012 20:08, Adelphe Rafanambinana wrote:
> I modified MyTicketChangeScriptCaller.py and here it is now:
>
>
> from subprocess import Popen
> from trac.core import *
> from trac.config import Option
> from trac.ticket import ITicketChangeListener
> class TicketChangeScript(Component):
> """ Calling a script file on ticket changes."""
> implements(ITicketChangeListener)
> script = Option('ticket_change_script', 'call', '',
> doc="/usr/local/bin/test.sh")
> # ITicketChangeListener Interface
> def ticket_created(self, ticket):
> self._call(ticket, 'created')
> def ticket_changed(self, ticket, comment, author, old_values):
> self._call(ticket, 'modified')
> # def ticket_deleted(self, ticket):
> # # Beware: We may not have all ticket properties here,
> # # just ticket number.
> # self._call(ticket, 'deleted')
> def _call(self, tkt, tkt_change):
> Popen([' '.join([self.script, tkt.id <http://tkt.id>,
> tkt['summary'], tkt_change])], shell=True)
>
>
> Now I got this error in Trac, after modifying a ticket:
>
>
> TypeError: sequence item 1: expected string or Unicode, int found
>
>
> Any idea how t fix it?
Yes, tkt.id is an integer, but obviously is expected as string/unicode,
so you'll want to change that like so:
tkt.id
to
str(tkt.id)
Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlB0dDAACgkQ31DJeiZFuHe6zgCg06G7fEFSCDwBLX7vnlpWD7Qn
rIkAnio0otvUShslMbLNAhyYBjc0k0SZ
=+e2E
-----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.