From 5304a00cbdd7e3f6e3026853b1cbfa5d01d0b4ce Mon Sep 17 00:00:00 2001 From: John Ellis Date: Tue, 7 Feb 2017 19:20:49 -0500 Subject: [PATCH] More GStreamer fixes and typos --- debian/changelog | 6 +++--- lib/hackclock/runapp/Libs/Clock.py | 7 ++++--- lib/hackclock/runapp/Libs/GStreamer.py | 1 - lib/hackclock/runapp/Libs/GoogleMusic.py | 5 +++-- package.sh | 2 +- setup.py | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 53c0588..fc5bcec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -hackclock (2.1.2-1) stable; urgency=low +hackclock (2.1.3-1) stable; urgency=low - * Fixed GStreamer issue introduced with v2.1.1 + * Fixed YET ANOTHER GStreamer issue introduced with v2.1.1 - -- DeckerEgo Mon, 06 Feb 2017 21:50:00 -0500 + -- DeckerEgo Tue, 07 Feb 2017 22:15:00 -0500 diff --git a/lib/hackclock/runapp/Libs/Clock.py b/lib/hackclock/runapp/Libs/Clock.py index 8a0087c..a58d131 100644 --- a/lib/hackclock/runapp/Libs/Clock.py +++ b/lib/hackclock/runapp/Libs/Clock.py @@ -34,13 +34,14 @@ def __executeEvents(self): def run(self): while self.__running: - if self.tickFunc: self.tickFunc() - self.__executeEvents() - self.__waitLock.acquire() totalWait = self.__RESOLUTION + self.additionalWait self.additionalWait = 0 self.__waitLock.release() + + if self.tickFunc: self.tickFunc() + self.__executeEvents() + time.sleep(totalWait / 1000.0) def atTime(self, hour, minute, action): diff --git a/lib/hackclock/runapp/Libs/GStreamer.py b/lib/hackclock/runapp/Libs/GStreamer.py index 8c7f9a5..16c9d5e 100644 --- a/lib/hackclock/runapp/Libs/GStreamer.py +++ b/lib/hackclock/runapp/Libs/GStreamer.py @@ -54,7 +54,6 @@ def stop(self): self.pl.set_state(gst.STATE_NULL) if self.eventLoop: self.eventLoop.quit() - gobject.threads_leave() def isPlaying(self): return gst.STATE_PLAYING in self.pl.get_state() if self.pl else False diff --git a/lib/hackclock/runapp/Libs/GoogleMusic.py b/lib/hackclock/runapp/Libs/GoogleMusic.py index 9313eb1..76cc22c 100644 --- a/lib/hackclock/runapp/Libs/GoogleMusic.py +++ b/lib/hackclock/runapp/Libs/GoogleMusic.py @@ -41,12 +41,13 @@ def __fetchTrackIDs(self, station_id): def pop(self): while self.__playlist: + track_id = self.__playlist.pop() + try: - track_id = self.__playlist.pop() stream_url = self.__client.get_stream_url(track_id, quality='low') return stream_url except(exceptions.CallFailure): - logger.warning("Failed to fetch Stream URL for ID %s" % trackid) + logger.warning("Failed to fetch Stream URL for ID %s" % track_id) raise IndexError("pop from empty list") diff --git a/package.sh b/package.sh index 144ee51..879df9f 100755 --- a/package.sh +++ b/package.sh @@ -7,7 +7,7 @@ rm home/pi/hack-clock/backups/blocks_clock.* cd .. echo "Compressing file..." -tar Jcf hackclock_2.1.2.orig.tar.xz hack-clock/ +tar Jcf hackclock_2.1.3.orig.tar.xz hack-clock/ cd hack-clock dpkg-buildpackage -rfakeroot -uc -us diff --git a/setup.py b/setup.py index be697ed..bd69751 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def all_files(newroot, oldroot): setup( name='HackClock', - version='2.1.1', + version='2.1.3', description='A hackable alarm clock for the Raspberry Pi', author='DeckerEgo', author_email='john@deckerego.net',