* Added a little work-around on python's threading.Thread to make Asynchronizer objects able to restart more than once.
This commit is contained in:
parent
6107611b44
commit
de73c5100d
|
@ -22,7 +22,7 @@
|
||||||
# documentation at http://code.google.com/p/pylast/wiki/Documentation
|
# documentation at http://code.google.com/p/pylast/wiki/Documentation
|
||||||
|
|
||||||
LIB_NAME = 'pyLast'
|
LIB_NAME = 'pyLast'
|
||||||
LIB_VERSION = '0.2b2'
|
LIB_VERSION = '0.2b3'
|
||||||
|
|
||||||
API_SERVER = 'ws.audioscrobbler.com'
|
API_SERVER = 'ws.audioscrobbler.com'
|
||||||
API_SUBDIR = '/2.0/'
|
API_SUBDIR = '/2.0/'
|
||||||
|
@ -140,6 +140,12 @@ class Asynchronizer(threading.Thread):
|
||||||
self._calls[call] = call_args
|
self._calls[call] = call_args
|
||||||
self._callbacks[call] = callback
|
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):
|
class Exceptionable(object):
|
||||||
"""An abstract class that adds support for error reporting."""
|
"""An abstract class that adds support for error reporting."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue