Skip to content

Commit

Permalink
fix incompatibility with pygmy by incrementing mpdclient; fix systray…
Browse files Browse the repository at this point in the history
… bug
  • Loading branch information
Scott Horowitz committed Sep 13, 2006
1 parent 6f103be commit fdb730f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@
'Topic :: Multimedia :: Sound :: Players',
],
py_modules = ['sonata'],
scripts = ['sonata', 'mpdclient2.py'],
scripts = ['sonata', 'mpdclient3.py'],
data_files=[('share/sonata',
['README', 'CHANGELOG', 'TODO']),
('share/applications',
Expand Down
18 changes: 9 additions & 9 deletions sonata.py
Expand Up @@ -42,7 +42,7 @@
try:
import gtk
import pango
import mpdclient2
import mpdclient3
except ImportError, (strerror):
print >>sys.stderr, "%s. Please make sure you have this library installed into a directory in Python's path or in the same directory as Sonata.\n" % strerror
sys.exit(1)
Expand All @@ -59,7 +59,7 @@
sys.stderr.write("Sonata requires PyGTK 2.6.0 or newer.\n")
sys.exit(1)

class Connection(mpdclient2.mpd_connection):
class Connection(mpdclient3.mpd_connection):
"""A connection to the daemon. Will use MPD_HOST/MPD_PORT in preference to the supplied config if available."""

def __init__(self, Base):
Expand All @@ -76,8 +76,8 @@ def __init__(self, Base):
if os.environ.has_key('MPD_PORT'):
port = int(os.environ['MPD_PORT'])

mpdclient2.mpd_connection.__init__(self, host, port, password)
mpdclient2.connect(host=host, port=port, password=password)
mpdclient3.mpd_connection.__init__(self, host, port, password)
mpdclient3.connect(host=host, port=port, password=password)
#if password: self.do.password(password)

def __repr__(self, host, port):
Expand All @@ -86,7 +86,7 @@ def __repr__(self, host, port):
else:
return "<Connection to %s:%s>" % (host, port)

class Base(mpdclient2.mpd_connection):
class Base(mpdclient3.mpd_connection):
def __init__(self):
# Initialize vars:
self.host = 'localhost'
Expand Down Expand Up @@ -542,7 +542,7 @@ def __init__(self):
def connect(self):
try:
return Connection(self)
except (mpdclient2.socket.error, EOFError):
except (mpdclient3.socket.error, EOFError):
return None

def update_status(self):
Expand All @@ -559,7 +559,7 @@ def update_status(self):
else:
self.status = None
self.songinfo = None
except (mpdclient2.socket.error, EOFError):
except (mpdclient3.socket.error, EOFError):
self.prevconn = self.conn
self.prevstatus = self.status
self.prevsonginfo = self.songinfo
Expand Down Expand Up @@ -1501,8 +1501,8 @@ def initialize_systrayicon(self):
self.trayicon = egg.trayicon.TrayIcon("TrayIcon")
self.trayicon.add(self.trayeventbox)
self.trayicon.show_all()
except NameError:
self.systraycheckbutton.set_property('sensitive', False)
except:
pass

def main(self):
gtk.main()
Expand Down

0 comments on commit fdb730f

Please sign in to comment.