From de73c5100d6c0a1f6f9ab2504789c5c96f306963 Mon Sep 17 00:00:00 2001 From: Amr Hassan Date: Sun, 31 Aug 2008 15:18:01 +0000 Subject: [PATCH] * Added a little work-around on python's threading.Thread to make Asynchronizer objects able to restart more than once. --- pylast.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pylast.py b/pylast.py index 69bf381..9dc006b 100644 --- a/pylast.py +++ b/pylast.py @@ -22,7 +22,7 @@ # documentation at http://code.google.com/p/pylast/wiki/Documentation LIB_NAME = 'pyLast' -LIB_VERSION = '0.2b2' +LIB_VERSION = '0.2b3' API_SERVER = 'ws.audioscrobbler.com' API_SUBDIR = '/2.0/' @@ -139,6 +139,12 @@ class Asynchronizer(threading.Thread): self._calls[call] = call_args self._callbacks[call] = callback + + def start(self): + """Since that Python thread objects can only be started once. This is my little work-around.""" + + threading.Thread.__init__(self) + super(Asynchronizer, self).start() class Exceptionable(object): """An abstract class that adds support for error reporting."""