Remove packaging dependency

This commit is contained in:
ybnd 2020-01-30 20:11:09 +01:00
parent c3817a4c06
commit 506be02597

View file

@ -25,7 +25,6 @@ import enum
import re
import xml.parsers.expat
from six.moves import zip
from packaging import version
from beets import ui
from beets.plugins import BeetsPlugin
@ -68,6 +67,11 @@ def call(args, **kwargs):
raise ReplayGainError(u"argument encoding failed")
def after_version(version_a, version_b):
return tuple(int(s) for s in version_a.split('.')) \
>= tuple(int(s) for s in version_b.split('.'))
def db_to_lufs(db):
"""Convert db to LUFS.
@ -263,7 +267,7 @@ class Bs1770gainBackend(Backend):
cmd = [self.command]
cmd += ["--" + method]
cmd += ['--xml', '-p']
if version.parse(self.version) >= version.parse('0.6.0'):
if after_version(self.version, '0.6.0'):
cmd += ['--unit=ebu'] # set units to LU
# Workaround for Windows: the underlying tool fails on paths