Sorry for not trying out your code, but it uses too many
components I am not willing to install - I read it though; so
I can comment on it a little.
First, let me say I am less impressed than you are with Mr.
Alex Revo effort. I am not flamebaiting here (this is none of
your fault anyway), and I am not saying it is not working,
usable code, or that Mr. Revo did a bad coding work, but he
certainly made discutable choices. I find the solution used a
big resource hog... Managing to use most of gnome, CORBA,
PIL, and a specialized SOAP module just to use playlists and
get some songs informations? That's some real achievement.
:lol:
Once again, it doesn't mean it is bad code, and it certainly
doesn't mean I will stand against arythmlet publication on
adesklets site later on. But it certainly goes somewhat
against adesklets whole objective of a leaner desklets
solution.
From what I read from your code, it appears you want these
functionnalities:
- Ability to use
playlists
- Ability to show the current
song informations, as well as some albums details, such as
the cover image
- Ability to play, stop, pause
songs
There are already plenty of python modules, relying only on
the bare environments, to do all this... Managing
AudioScrobbler,
Amazon
connections, playing a variety of files to your sound
card (gstreamer already used here is pretty lean... No reason
for you not
to invoque it from the command line in Python through
gst-launch).
As for your threading problem, it is hard for me to give you
an answer, since I cannot run your code. I can only state you
the obvious: you are trying to launch a thread that was
already started previously, which seems possible, since the
Cover constructor is only invoked in
Events::ready(). So, at the second
iteration through
Events::_display(), this can very well
strike you if the thread did not exist already.
I'd like to add that you have to be extra careful with
adesklets python package when using threading, as adesklets
rely on correct basic signal handlings to work. On POSIX
systems, asynchronous signals such as SIGUSR1. often sent by
the adesklets interpreter to the python script, are by
default handled by an arbitrary thread within the process. If
it get caught by anything than the launching thread, you
could be in trouble.