diff options
author | Mike Crute <mcrute@gmail.com> | 2016-10-08 12:29:01 -0700 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2016-10-08 12:29:01 -0700 |
commit | 0cc8f116afe9348e3bafae265b2ecfe8e13f13b8 (patch) | |
tree | 106a217dae45fa22db81ccc91bb8f48bbf552fa3 | |
parent | b7089611affc251ca1aea76995d960a5b259fc22 (diff) | |
download | pydora-0cc8f116afe9348e3bafae265b2ecfe8e13f13b8.tar.bz2 pydora-0cc8f116afe9348e3bafae265b2ecfe8e13f13b8.tar.xz pydora-0cc8f116afe9348e3bafae265b2ecfe8e13f13b8.zip |
Don't downcast unicode to bytes in player
fixes #48
-rwxr-xr-x | pydora/player.py | 6 | ||||
-rw-r--r-- | pydora/utils.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pydora/player.py b/pydora/player.py index 6e93df5..b2d9c31 100755 --- a/pydora/player.py +++ b/pydora/player.py | |||
@@ -84,7 +84,7 @@ class PlayerApp(object): | |||
84 | 84 | ||
85 | for i, station in enumerate(self.stations): | 85 | for i, station in enumerate(self.stations): |
86 | i = "{:>3}".format(i) | 86 | i = "{:>3}".format(i) |
87 | print("{}: {}".format(Colors.yellow(i), station.name)) | 87 | print(u"{}: {}".format(Colors.yellow(i), station.name)) |
88 | 88 | ||
89 | return self.stations[Screen.get_integer("Station: ")] | 89 | return self.stations[Screen.get_integer("Station: ")] |
90 | 90 | ||
@@ -92,9 +92,9 @@ class PlayerApp(object): | |||
92 | """Play callback | 92 | """Play callback |
93 | """ | 93 | """ |
94 | if song.is_ad: | 94 | if song.is_ad: |
95 | print("{} ".format(Colors.cyan("Advertisement"))) | 95 | print(u"{} ".format(Colors.cyan("Advertisement"))) |
96 | else: | 96 | else: |
97 | print("{} by {}".format(Colors.cyan(song.song_name), | 97 | print(u"{} by {}".format(Colors.cyan(song.song_name), |
98 | Colors.yellow(song.artist_name))) | 98 | Colors.yellow(song.artist_name))) |
99 | 99 | ||
100 | def skip_song(self, song): | 100 | def skip_song(self, song): |
diff --git a/pydora/utils.py b/pydora/utils.py index 3c3aa39..47422d6 100644 --- a/pydora/utils.py +++ b/pydora/utils.py | |||
@@ -22,8 +22,8 @@ class Colors(object): | |||
22 | def inner(text, bold=False): | 22 | def inner(text, bold=False): |
23 | code = raw_code | 23 | code = raw_code |
24 | if bold: | 24 | if bold: |
25 | code = "1;{}".format(code) | 25 | code = u"1;{}".format(code) |
26 | return "\033[{}m{}\033[0m".format(code, text) | 26 | return u"\033[{}m{}\033[0m".format(code, text) |
27 | return inner | 27 | return inner |
28 | 28 | ||
29 | red = __wrap_with("31") | 29 | red = __wrap_with("31") |