mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 20:43:41 +01:00
use explicit integer division syntax (//)
This commit is contained in:
parent
d82d74b422
commit
16f706bb8c
2 changed files with 7 additions and 3 deletions
|
|
@ -15,6 +15,8 @@
|
|||
"""Matches existing metadata with canonical information to identify
|
||||
releases and tracks.
|
||||
"""
|
||||
from __future__ import division
|
||||
|
||||
import logging
|
||||
import re
|
||||
from munkres import Munkres
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
"""Miscellaneous utility functions."""
|
||||
from __future__ import division
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
|
@ -149,7 +151,7 @@ def components(path, pathmod=None):
|
|||
comp = pathmod.basename(anc)
|
||||
if comp:
|
||||
comps.append(comp)
|
||||
else: # root
|
||||
else: # root
|
||||
comps.append(anc)
|
||||
|
||||
last = pathmod.basename(path)
|
||||
|
|
@ -337,10 +339,10 @@ def sanitize_for_path(value, pathmod, key=None):
|
|||
value = u'%02i' % (value or 0)
|
||||
elif key == 'bitrate':
|
||||
# Bitrate gets formatted as kbps.
|
||||
value = u'%ikbps' % ((value or 0) / 1000)
|
||||
value = u'%ikbps' % ((value or 0) // 1000)
|
||||
elif key == 'samplerate':
|
||||
# Sample rate formatted as kHz.
|
||||
value = u'%ikHz' % ((value or 0) / 1000)
|
||||
value = u'%ikHz' % ((value or 0) // 1000)
|
||||
else:
|
||||
value = unicode(value)
|
||||
return value
|
||||
|
|
|
|||
Loading…
Reference in a new issue