mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
Handle some pylint and bandit warnings
This commit is contained in:
@@ -475,7 +475,7 @@ class ClusterDict(object):
|
||||
index, count = self.words[word]
|
||||
if index == -1:
|
||||
token = self.tokenize(word)
|
||||
if token == '':
|
||||
if token == '': # nosec
|
||||
return -1
|
||||
index = self.id
|
||||
self.ids[index] = (word, token)
|
||||
|
||||
@@ -158,7 +158,7 @@ class CoverArt:
|
||||
finally:
|
||||
if ret != CoverArtProvider.WAIT:
|
||||
self.next_in_queue()
|
||||
return
|
||||
return
|
||||
except StopIteration:
|
||||
# nothing more to do
|
||||
self.album._finalize_loading(None)
|
||||
|
||||
@@ -64,7 +64,7 @@ class DataHash:
|
||||
self._filename = None
|
||||
_datafile_mutex.lock()
|
||||
try:
|
||||
m = md5()
|
||||
m = md5() # nosec
|
||||
m.update(data)
|
||||
self._hash = m.hexdigest()
|
||||
if self._hash not in _datafiles:
|
||||
@@ -337,7 +337,8 @@ class CoverArtImage:
|
||||
except OSError as e:
|
||||
raise CoverArtImageIOError(e)
|
||||
|
||||
def _next_filename(self, filename, counters):
|
||||
@staticmethod
|
||||
def _next_filename(filename, counters):
|
||||
if counters[filename]:
|
||||
new_filename = "%s (%d)" % (decode_filename(filename), counters[filename])
|
||||
else:
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
"""Build a Qt resources file with all png images found under images/
|
||||
It will update qrc file only if images newer than it are found
|
||||
"""
|
||||
|
||||
from distutils import log
|
||||
from distutils.dep_util import newer
|
||||
@@ -31,20 +34,15 @@ import os
|
||||
import re
|
||||
|
||||
|
||||
"""Build a Qt resources file with all png images found under images/
|
||||
It will update qrc file only if images newer than it are found
|
||||
"""
|
||||
|
||||
|
||||
def tryint(s):
|
||||
try:
|
||||
return int(s)
|
||||
except:
|
||||
except BaseException:
|
||||
return s
|
||||
|
||||
|
||||
def natsort_key(s):
|
||||
return [ tryint(c) for c in re.split(r'(\d+)', s) ]
|
||||
return [tryint(c) for c in re.split(r'(\d+)', s)]
|
||||
|
||||
|
||||
def find_files(topdir, directory, patterns):
|
||||
|
||||
Reference in New Issue
Block a user