1. Travis Shirk
  2. eyeD3

Commits

Travis Shirk  committed 9ab02b1

python3 fixes

  • Participants
  • Parent commits a0196b6
  • Branches stable

Comments (0)

Files changed (5)

File src/eyed3/__init__.py

View file
  • Ignore whitespace
 import sys
 import locale
 import exceptions
+from .compat import StringTypes
 
 
 _DEFAULT_ENCODING = "latin1"
     API compatibility is currently based on major and minor version values,
     therefore neither version 0.6 or 0.8 is compatible for version 0.7.
     '''
-    import types
     from .info import VERSION_TUPLE as CURRENT_VERSION
 
     def t2s(_t):
         return ".".join([str(v) for v in _t])
 
     req_version = None
-    if type(version_spec) in types.StringTypes:
+    if type(version_spec) in StringTypes:
         req_version = tuple((int(v) for v in version_spec.split(".")))
     else:
         req_version = tuple(version_spec)

File src/eyed3/id3/frames.py

View file
  • Ignore whitespace
     "PCS" : "PCST", # iTunes extension for podcast marking.
 }
 
-import apple
+from . import apple
 NONSTANDARD_ID3_FRAMES = {
     "NCON": ("Undefined MusicMatch extension", ID3_V2, Frame),
     "TCMP": ("iTunes complilation flag extension", ID3_V2, TextFrame),

File src/eyed3/plugins/lameinfo.py

View file
  • Ignore whitespace
 
         format = '%-20s: %s'
         lt = self.audio_file.info.lame_tag
-        if not lt.has_key('infotag_crc'):
+        if "infotag_crc" not in lt:
             try:
                 printMsg('%s: %s' % ('Encoder Version', lt['encoder_version']))
             except KeyError:
         values.append(('VBR Method', lt['vbr_method']))
         values.append(('Lowpass Filter', lt['lowpass_filter']))
 
-        if lt.has_key('replaygain'):
+        if "replaygain" in lt:
            try:
                peak = lt['replaygain']['peak_amplitude']
                db = 20 * math.log10(peak)

File src/test/mp3/test_infos.py

View file
  • Ignore whitespace
 
     python -m test.mp3.test_infos <file>
 '''
+from __future__ import print_function
 import eyed3
 import sys
 import os

File src/test/test_plugins.py

View file
  • Ignore whitespace
 
 def test_load():
     plugins = load()
-    assert_in("classic", plugins.keys())
-    assert_in("genres", plugins.keys())
+    assert_in("classic", list(plugins.keys()))
+    assert_in("genres", list(plugins.keys()))
 
     assert_equal(load("classic"), plugins["classic"])
     assert_equal(load("genres"), plugins["genres"])