Merge branch 'master' into add-mailmap

This commit is contained in:
Sambhav Kothari
2017-03-04 21:51:23 +05:30
committed by GitHub
12 changed files with 16 additions and 15 deletions

View File

@@ -58,7 +58,7 @@ def version_to_string(version, short=False):
return version_str
_version_re = re.compile("(\d+)[._](\d+)(?:[._](\d+)[._]?(?:(dev|final)[._]?(\d+))?)?$")
_version_re = re.compile(r"(\d+)[._](\d+)(?:[._](\d+)[._]?(?:(dev|final)[._]?(\d+))?)?$")
def version_from_string(version_str):

View File

@@ -33,7 +33,7 @@ class ProviderOptionsLocal(ProviderOptions):
Options for Local Files cover art provider
"""
_DEFAULT_LOCAL_COVER_ART_REGEX = '^(?:cover|folder|albumart)(.*)\.(?:jpe?g|png|gif|tiff?)$'
_DEFAULT_LOCAL_COVER_ART_REGEX = r'^(?:cover|folder|albumart)(.*)\.(?:jpe?g|png|gif|tiff?)$'
options = [
config.TextOption("setting", "local_cover_regex",

View File

@@ -175,7 +175,7 @@ class APEv2File(File):
for tag in metadata.deleted_tags:
real_name = str(self._get_tag_name(tag))
if real_name in ('Lyrics', 'Comment', 'Performer'):
tag_type = "\(%s\)" % tag.split(':', 1)[1]
tag_type = r"\(%s\)" % tag.split(':', 1)[1]
for item in tags.get(real_name):
if re.search(tag_type, item):
tags.get(real_name).remove(item)

View File

@@ -227,7 +227,7 @@ class VCommentFile(File):
real_name = self._get_tag_name(tag)
if real_name and real_name in tags:
if real_name in ('performer', 'comment'):
tag_type = "\(%s\)" % tag.split(':', 1)[1]
tag_type = r"\(%s\)" % tag.split(':', 1)[1]
for item in tags.get(real_name):
if re.search(tag_type, item):
tags.get(real_name).remove(item)

View File

@@ -127,7 +127,7 @@ def isidentif(ch):
class ScriptParser(object):
"""Tagger script parser.
r"""Tagger script parser.
Grammar:
text ::= [^$%] | '\$' | '\%' | '\(' | '\)' | '\,'
@@ -373,7 +373,7 @@ def func_pad(parser, text, length, char):
def func_strip(parser, text):
return re.sub("\s+", " ", text).strip()
return re.sub(r"\s+", " ", text).strip()
def func_replace(parser, text, old, new):

View File

@@ -40,7 +40,7 @@ def similarity(a1, b1):
return astrcmp(a2, b2)
_split_words_re = re.compile('\W+', re.UNICODE)
_split_words_re = re.compile(r'\W+', re.UNICODE)
def similarity2(a, b):

View File

@@ -486,6 +486,7 @@ class BaseTreeView(QtGui.QTreeWidget):
log.debug('OSX NSURL path detected. Dropped File is: %r', filename)
else:
log.error("Unable to get appropriate file path for %r", url.toString(QtCore.QUrl.RemoveUserInfo))
continue
else:
# Dropping a file from iTunes gives a filename with a NULL terminator
filename = os.path.normpath(os.path.realpath(unicode(url.toLocalFile()).rstrip("\0")))

View File

@@ -70,7 +70,7 @@ class TagsFromFileNamesDialog(PicardDialog):
item = QtGui.QTreeWidgetItem(self.ui.files)
item.setText(0, os.path.basename(file.filename))
self.items.append(item)
self._tag_re = re.compile("(%\w+%)")
self._tag_re = re.compile(r"(%\w+%)")
self.numeric_tags = ('tracknumber', 'totaltracks', 'discnumber', 'totaldiscs')
def parse_format(self):
@@ -82,9 +82,9 @@ class TagsFromFileNamesDialog(PicardDialog):
name = part[1:-1]
columns.append(name)
if name in self.numeric_tags:
format_re.append('(?P<' + name + '>\d+)')
format_re.append('(?P<' + name + r'>\d+)')
elif name in ('date'):
format_re.append('(?P<' + name + '>\d+(?:-\d+(?:-\d+)?)?)')
format_re.append('(?P<' + name + r'>\d+(?:-\d+(?:-\d+)?)?)')
else:
format_re.append('(?P<' + name + '>[^/]*?)')
else:

View File

@@ -155,7 +155,7 @@ def _shorten_to_utf16_ratio(text, ratio):
def _make_win_short_filename(relpath, reserved=0):
"""Shorten a relative file path according to WinAPI quirks.
r"""Shorten a relative file path according to WinAPI quirks.
relpath: The file's path.
reserved: Number of characters reserved for the parent path to be joined with,

View File

@@ -18,7 +18,7 @@ def tryint(s):
def natsort_key(s):
return [ tryint(c) for c in re.split('(\d+)', s) ]
return [ tryint(c) for c in re.split(r'(\d+)', s) ]
def find_files(topdir, directory, patterns):

View File

@@ -429,7 +429,7 @@ try:
def finalize_options(self):
babel.extract_messages.finalize_options(self)
if input_dirs_workaround and self._input_dirs:
self.input_dirs = re.split(',\s*', self._input_dirs)
self.input_dirs = re.split(r',\s*', self._input_dirs)
except ImportError:
class picard_regen_pot_file(Command):
@@ -707,7 +707,7 @@ try:
py2exe.run(self)
print("*** creating the NSIS setup script ***")
pathname = "installer\picard-setup.nsi"
pathname = r"installer\picard-setup.nsi"
generate_file(pathname + ".in", pathname,
{'name': 'MusicBrainz Picard',
'version': __version__,

View File

@@ -103,7 +103,7 @@ combinations_to = (
u"jLqdzdztslslzBDLuebdfmnprrstzthIpUbdfgklmnprsvx"
u"zadeeiussSSLLllVvYy(C)(R)CECrFr.L.PtsTLRsRx,.x/.ddHhts"
)
ascii = u" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
ascii = u" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
class CompatibilityTest(unittest.TestCase):