From efed5409610273aadeb8f5c53fa89ae76f076c7f Mon Sep 17 00:00:00 2001 From: Mikhail Osipov Date: Sun, 17 Nov 2013 17:10:40 +0400 Subject: fix python2 unicode related problems --- cutter.py | 4 ++-- cutter/cue.py | 4 ++-- cutter/formats/flac.py | 2 +- cutter/formats/ogg.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cutter.py b/cutter.py index d4dfd1c..043fbab 100755 --- a/cutter.py +++ b/cutter.py @@ -213,9 +213,9 @@ def parse_args(): for opt in tag_options: if type(opt) in (list, tuple): - tag.add_argument(*["--" + s for s in opt], default="") + tag.add_argument(*["--" + s for s in opt], type=to_unicode, default="") else: - tag.add_argument("--" + opt, default="") + tag.add_argument("--" + opt, type=to_unicode, default="") tag.add_argument("--track-total", type=int, dest="tracktotal", metavar="TOTAL") tag.add_argument("--track-start", type=int, dest="trackstart", metavar="START") diff --git a/cutter/cue.py b/cutter/cue.py index fdc712d..578f600 100644 --- a/cutter/cue.py +++ b/cutter/cue.py @@ -27,7 +27,7 @@ class Track: def get(self, attr): return self._attrs.get(attr, - None if attr in ("pregap", "postgap") else "" + None if attr in ("pregap", "postgap") else u"" ) def isaudio(self): @@ -75,7 +75,7 @@ class Cue: return filter(File.isaudio if filter_audio else None, self._files) def get(self, attr): - return self._attrs.get(attr, "") + return self._attrs.get(attr, u"") def add_file(self, file): self._files.append(file) diff --git a/cutter/formats/flac.py b/cutter/formats/flac.py index 46fde6d..87a7135 100644 --- a/cutter/formats/flac.py +++ b/cutter/formats/flac.py @@ -24,7 +24,7 @@ class FlacHandler(SoxHandler): return False for k, v in tags.items(): - if v is not "": + if v is not u"": proc.stdin.write(to_bytes("%s=%s\n" % (k.upper(), v))) proc.stdin.close() diff --git a/cutter/formats/ogg.py b/cutter/formats/ogg.py index cef7d20..389d421 100644 --- a/cutter/formats/ogg.py +++ b/cutter/formats/ogg.py @@ -20,7 +20,7 @@ class OggHandler(SoxHandler): return False for k, v in tags.items(): - if v is not "": + if v is not u"": proc.stdin.write(to_bytes("%s=%s\n" % (k.upper(), v))) proc.stdin.close() -- cgit v1.2.3-70-g09d2