Merge with bugfix-0.5

file:638f893a37e3458a9568aeaa8be0289e5c018473 -> file:4766166d9fffbc6760f4c1c29e252e4deabf01a5
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+mp3togo (0.5.5) unstable; urgency=low
+
+ * Added support for python-eyeD3 for more robust handling of unicode tags.
+ * python-ID3 is still supported and will be used if eyeD3 is not available.
+
+ -- Simeon Veldstra <reallifesim@gmail.com> Mon, 26 Jun 2006 19:17:31 -0700
+
+mp3togo (0.5.4) unstable; urgency=low
+
+ * Changed the ogg decoder to oggdec from ogg123 to fix bug on Debian Stable (Sarge).
+
+ -- Simeon Veldstra <reallifesim@gmail.com> Mon, 12 Jun 2006 19:46:05 -0700
+
mp3togo (0.5.3) unstable; urgency=low
* Added Justus Pendleton's patch to fix config file bug.
file:88af3b75fea4c0a67a7a2a4b50f4daeafbb7ef2c -> file:de9383d1c30cbaf2a458eb878699c456b31b40ff
--- a/debian/control
+++ b/debian/control
@@ -2,12 +2,13 @@ Source: mp3togo
Section: sound
Priority: optional
Maintainer: Simeon Veldstra <reallifesim@gmail.com>
-Build-Depends: cdbs, debhelper (>= 4.2.0), python, docbook-to-man
-Standards-Version: 3.6.2
+Build-Depends: cdbs, debhelper (>= 4.2.0)
+Build-Depends-Indep: python, docbook-to-man
+Standards-Version: 3.7.2
Package: mp3togo
Architecture: all
-Depends: ${python:Depends}, python-pyvorbis, python-id3, mpg321, vorbis-tools
+Depends: ${python:Depends}, python-pyvorbis, python-eyeD3, mpg321, vorbis-tools
Recommends: flac, normalize-audio
Suggests: lame, python-xmms, faad
Description: A tool for loading music on to portable mp3 players
file:55ae8cc7bade832514d43c6893c6886821822dcf -> file:7ee7774fab25a83486bbea7b7c253e168041e0db
--- a/debian/mp3togo.1
+++ b/debian/mp3togo.1
@@ -134,4 +134,4 @@ License can be found in /usr/share/commo
.PP
mp3togo can be found online at http://puddle.ca/mp3togo
-.\" created by instant / docbook-to-man, Tue 06 Jun 2006, 19:24
+.\" created by instant / docbook-to-man, Mon 26 Jun 2006, 19:31
file:c17b271db87d6f8dd547807475889281e6f523bc -> file:3a5cf725b53a08fac1eb1ef9d10c911a29659663
--- a/mp3togo/helpers.py
+++ b/mp3togo/helpers.py
@@ -76,6 +76,13 @@ def parse_mpg321(buf, f=frames()):
return f.frames/f.tframes * 100.0
return 0
+def parse_oggdec(buf):
+ s = buf.split('\r')
+ if len(s) == 2 and len(s[1]) == 9:
+ return float(s[1][2:7])
+ else:
+ return 0.0
+
def parse_oggenc(buf):
# From "jack"
s = buf.split('\r')
@@ -185,8 +192,13 @@ helpers = {
'type': 'wav',
'factor': 1,
'action': 'encode'},
- 'ogg123' : {'parser': parse_ogg123,
- 'cmd': 'ogg123 -d wav -f %o %i',
+# 'ogg123' : {'parser': parse_ogg123,
+# 'cmd': 'ogg123 -d wav -f %o %i',
+# 'type': 'ogg',
+# 'factor': 16.5,
+# 'action': 'decode'},
+ 'ogg123' : {'parser': parse_oggdec,
+ 'cmd': 'oggdec -o %o %i',
'type': 'ogg',
'factor': 16.5,
'action': 'decode'},
file:d0677643dda65fa9d4d708668bbe3717801c1084 -> file:2ef76dee5e293f844864ea21f9282ef510997302
--- a/mp3togo/tags.py
+++ b/mp3togo/tags.py
@@ -35,12 +35,21 @@ else:
HAVE_VORBIS = True
try:
+ import eyeD3
+except ImportError:
+ HAVE_eyeD3 = False
+else:
+ HAVE_eyeD3 = True
+
+try:
import ID3
except ImportError:
HAVE_ID3 = False
else:
HAVE_ID3 = True
+import codecs
+
HAVE_METAFLAC=False
for path in os.environ['PATH'].split(':'):
if os.path.exists(os.path.join(path, 'metaflac')):
@@ -84,9 +93,18 @@ class Tags(UserDict.DictMixin):
return o
if self._type == 'mp3' and HAVE_ID3:
- info = ID3.ID3(self._file, as_tuple=1).as_dict()
- self._tags = copytags(info)
- del info
+ if HAVE_eyeD3:
+ eye = eyeD3.Tag()
+ eye.link(self._file)
+ self._tags['ARTIST'] = [eye.getArtist() or '']
+ self._tags['ALBUM'] = [eye.getAlbum() or '']
+ self._tags['TITLE'] = [eye.getTitle() or '']
+ self._tags['GENRE'] = [eye.getGenre().name or '']
+ del eye
+ elif HAVE_ID3:
+ info = ID3.ID3(self._file, as_tuple=1).as_dict()
+ self._tags = copytags(info)
+ del info
elif self._type == 'ogg' and HAVE_VORBIS:
info = ogg.vorbis.VorbisFile(self._file).comment().as_dict()
self._tags = copytags(info)
@@ -158,14 +176,31 @@ class Tags(UserDict.DictMixin):
del out
del vf
elif fmt == 'mp3':
- out = ID3.ID3(filename, as_tuple=1)
- puttags(out)
- try:
- out.write()
- except:
- # Tagging failed, but the file should be okay.
- pass
- del out
+ if HAVE_eyeD3:
+ out = eyeD3.Tag()
+ out.link(filename, eyeD3.ID3_V1)
+ out.setVersion(eyeD3.ID3_V1)
+ d = {}
+ d = puttags(d)
+ out.setArtist(d['ARTIST'])
+ out.setAlbum(d['ALBUM'])
+ out.setTitle(d['TITLE'])
+ g = eyeD3.Genre()
+ g.setId(d['GENRE'])
+ out.setGenre(g)
+ if d.has_key('COMMENT'):
+ out.addComment(d['COMMENT'])
+ out.update()
+ del out
+ elif HAVE_ID3:
+ out = ID3.ID3(filename, as_tuple=1)
+ puttags(out)
+ try:
+ out.write()
+ except:
+ # Tagging failed, but the file should be okay.
+ pass
+ del out
else:
self._lock.release()
raise setup.ErrorUnknownFileType
@@ -179,7 +214,7 @@ class Tags(UserDict.DictMixin):
return False
try:
- ifile = file(indexname, 'a')
+ ifile = codecs.open(indexname, 'a', 'utf-8')
ifile.write(filename + "\n")
keys = self._tags.keys()
keys.sort()
file:62d26dc3ebbe2bcbdd8810586f0435520715ac4c -> file:ac10703f5937fe63cdce5e939ab5ee7c40d64004
--- a/mp3togo/task.py
+++ b/mp3togo/task.py
@@ -42,13 +42,13 @@ DONE = 'done'
class SimpleTask:
"""Run a callable and save its output"""
- def __init__(self, parent, action, filter=None, reverse=None, tmpsize=0, outsize=0, name=''):
+ def __init__(self, parent, action, fltr=None, reverse=None, tmpsize=0, outsize=0, name=''):
if not action:
raise TypeError
if str(self.__class__).endswith('SimpleTask'):
if not callable(action):
raise TypeError
- for func in (filter, reverse):
+ for func in (fltr, reverse):
if func:
if not callable(func):
raise TypeError
@@ -58,7 +58,7 @@ class SimpleTask:
self.outsize = outsize
self._parent = parent
self._action = action
- self._filter = filter
+ self._filter = fltr
self._reverse = reverse
# Hold runlock while accessing self._status
self._runlock = threading.Lock()
@@ -266,7 +266,10 @@ class Task(SimpleTask):
try:
wpid, status = os.waitpid(pid, 0)
if os.WIFSIGNALED(status):
- self._status = FAILED
+ if os.WTERMSIG(status) == signal.SIGHUP:
+ self._status = FAILED
+ else:
+ self._status = FAILED
elif os.WEXITSTATUS(status) == 0:
self._status = DONE
else: