From 6917999b1a846e517d13873040143e772ffe3d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Mon, 4 Nov 2013 16:25:31 +0100 Subject: [PATCH] hook encode_line to show progress in GIMP plugin --- pysstv/examples/gimp-plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pysstv/examples/gimp-plugin.py b/pysstv/examples/gimp-plugin.py index 0c99857..4670ef8 100755 --- a/pysstv/examples/gimp-plugin.py +++ b/pysstv/examples/gimp-plugin.py @@ -32,7 +32,12 @@ class AudioThread(Thread): class Transmitter(object): def __init__(self, sstv, root): + def encode_line_hooked(line): + print line # TODO show progress on GUI + return self.original_encode_line(line) self.sstv = sstv + self.original_encode_line = sstv.encode_line + sstv.encode_line = encode_line_hooked self.root = root self.tx_enabled = IntVar() self.audio_thread = None