Skip to content

Commit 9de7b76

Browse files
committed
Fixed imports on lessons; filtered out explicit tracks on Google Music
1 parent 83d13f3 commit 9de7b76

File tree

14 files changed

+46
-42
lines changed

14 files changed

+46
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ I'm assuming that you are starting with the Raspian Minimal Linux distribution.
2121
1. Make sure your Raspberry Pi is up to date with the latest packages & firmware with `sudo apt-get update; sudo apt-get dist-upgrade`
2222
2. Enable I2C by executing `sudo raspi-config` as described in Adafruit's tutorial: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
2323
3. Add the necessary Python and GStreamer dependencies using the command: `sudo apt-get install wiringpi python-bottle python-requests python-oauth2client python-httplib2 python-setuptools python-pip python-dev python-dateutil python-smbus gstreamer0.10-x gstreamer-tools gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly python-gst0.10`
24-
4. Install hack-clock via `wget https://github.com/deckerego/hack-clock/releases/download/2.1.7/python-hackclock_2.1.7-1_all.deb; sudo dpkg -i python-hackclock_2.1.7-1_all.deb`
24+
4. Install hack-clock via `wget https://github.com/deckerego/hack-clock/releases/download/2.1.8/python-hackclock_2.1.8-1_all.deb; sudo dpkg -i python-hackclock_2.1.8-1_all.deb`
2525
5. Tweak `/etc/hack-clock.conf` and `/etc/default/hack-clock` to fit your needs (GPIO pins, correct weather station, etc.). A list of observed weather stations is available at http://forecast.weather.gov/stations.php
2626
6. Reboot your Pi to re-load modules and start the IDE web server
2727

debian/changelog

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
hackclock (2.1.7-1) stable; urgency=low
1+
hackclock (2.1.8-1) stable; urgency=low
22

3-
* Detect if I2S is already _ignored_, then allow standard Pi audio to continue
4-
* Changed icons for "save" and "restore" in IDE
3+
* Filter out explicit songs from Google Music radio streams
54

65
-- DeckerEgo <[email protected]> Tue, 01 Mar 2017 21:32:00 -0500

home/pi/hack-clock/lessons/1/run_clock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/python
22

3-
from Libs.Clock import Clock
4-
from Libs.SevenSegment import Display
3+
from hackclock.runapp.Libs.Clock import Clock
4+
from hackclock.runapp.Libs.SevenSegment import Display
55

66
# Connect to the internal machine clock
77
clock = Clock()

home/pi/hack-clock/lessons/2/run_clock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
66

77
# Connect to the internal machine clock
88
clock = Clock()

home/pi/hack-clock/lessons/3/run_clock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
66

77
# Connect to the internal machine clock
88
clock = Clock()

home/pi/hack-clock/lessons/4/run_clock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
6-
from Libs.GStreamer import Speaker
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
6+
from hackclock.runapp.Libs.GStreamer import Speaker
77

88
# Connect to the internal machine clock
99
clock = Clock()

home/pi/hack-clock/lessons/5/run_clock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
6-
from Libs.Input import Button
7-
from Libs.GStreamer import Speaker
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
6+
from hackclock.runapp.Libs.Input import Button
7+
from hackclock.runapp.Libs.GStreamer import Speaker
88

99
# Connect to the internal machine clock
1010
clock = Clock()

home/pi/hack-clock/lessons/6/run_clock.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
6-
from Libs.Weather import Weather
7-
from Libs.Input import Button
8-
from Libs.GStreamer import Speaker
9-
from config import configuration
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
6+
from hackclock.runapp.Libs.Weather import Weather
7+
from hackclock.runapp.Libs.Input import Button
8+
from hackclock.runapp.Libs.GStreamer import Speaker
9+
from hackclock.config import configuration
1010

1111
# The weather station
1212
station_name = configuration.get('weather_station')

home/pi/hack-clock/lessons/final/run_clock.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/python
22

33
from datetime import datetime
4-
from Libs.Clock import Clock
5-
from Libs.SevenSegment import Display
6-
from Libs.Weather import Weather
7-
from Libs.Input import Button
8-
from Libs.GStreamer import Speaker
9-
from config import configuration
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.SevenSegment import Display
6+
from hackclock.runapp.Libs.Weather import Weather
7+
from hackclock.runapp.Libs.Input import Button
8+
from hackclock.runapp.Libs.GStreamer import Speaker
9+
from hackclock.config import configuration
1010

1111
# The weather station
1212
station_name = configuration.get('weather_station')

home/pi/hack-clock/lessons/gpio/run_clock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from datetime import datetime
2-
from Libs.SevenSegment import Display
3-
from Libs.Output import Switch
4-
from Libs.Clock import Clock
5-
from Libs.Input import Button
2+
from hackclock.runapp.Libs.SevenSegment import Display
3+
from hackclock.runapp.Libs.Output import Switch
4+
from hackclock.runapp.Libs.Clock import Clock
5+
from hackclock.runapp.Libs.Input import Button
66

77
Is_Evening = None
88
LED_On = None

home/pi/hack-clock/lessons/musiclover/run_clock.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
from datetime import datetime
44
import random
5-
from Libs.Clock import Clock
6-
from Libs.SevenSegment import Display
7-
from Libs.Weather import Weather
8-
from Libs.Input import Button
9-
from Libs.GStreamer import Speaker
10-
from config import configuration
5+
from hackclock.runapp.Libs.Clock import Clock
6+
from hackclock.runapp.Libs.SevenSegment import Display
7+
from hackclock.runapp.Libs.Weather import Weather
8+
from hackclock.runapp.Libs.Input import Button
9+
from hackclock.runapp.Libs.GStreamer import Speaker
10+
from hackclock.config import configuration
1111

1212
# Connect to the internal machine clock
1313
clock = Clock()

lib/hackclock/runapp/Libs/GoogleMusic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
logger = logging.getLogger('google_music')
88

99
console = logging.StreamHandler()
10-
console.setLevel(logging.WARNING)
10+
console.setLevel(logging.DEBUG)
1111
logger.addHandler(console)
1212

1313
class AudioStream:
@@ -34,6 +34,11 @@ def __fetchTrackIDs(self, station_id):
3434
tracklist = self.__client.get_station_tracks(station_id, num_tracks=self.__track_prefetch)
3535
logger.info("Received tracks: %r" % json.dumps(tracklist))
3636

37+
# Filter out explicit tracks, where non-explicit is explicitType=2
38+
tracklist = [track for track in tracklist if not 'explicitType' in track or track['explicitType'] == "2"]
39+
logger.info("Non-explicit tracks: %r" % json.dumps(tracklist))
40+
41+
# Fetch both song IDs and Nautilus (old) IDs
3742
songids = [track['id'] for track in tracklist if 'id' in track]
3843
nautids = [track['nid'] for track in tracklist if 'nid' in track]
3944

package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rm home/pi/hack-clock/backups/blocks_clock.*
77

88
cd ..
99
echo "Compressing file..."
10-
tar Jcf hackclock_2.1.7.orig.tar.xz hack-clock/
10+
tar Jcf hackclock_2.1.8.orig.tar.xz hack-clock/
1111

1212
cd hack-clock
1313
dpkg-buildpackage -rfakeroot -uc -us

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def all_files(newroot, oldroot):
2727

2828
setup(
2929
name='HackClock',
30-
version='2.1.7',
30+
version='2.1.8',
3131
description='A hackable alarm clock for the Raspberry Pi',
3232
author='DeckerEgo',
3333
author_email='[email protected]',

0 commit comments

Comments
 (0)