mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-27 11:47:34 +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]
|
index, count = self.words[word]
|
||||||
if index == -1:
|
if index == -1:
|
||||||
token = self.tokenize(word)
|
token = self.tokenize(word)
|
||||||
if token == '':
|
if token == '': # nosec
|
||||||
return -1
|
return -1
|
||||||
index = self.id
|
index = self.id
|
||||||
self.ids[index] = (word, token)
|
self.ids[index] = (word, token)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class DataHash:
|
|||||||
self._filename = None
|
self._filename = None
|
||||||
_datafile_mutex.lock()
|
_datafile_mutex.lock()
|
||||||
try:
|
try:
|
||||||
m = md5()
|
m = md5() # nosec
|
||||||
m.update(data)
|
m.update(data)
|
||||||
self._hash = m.hexdigest()
|
self._hash = m.hexdigest()
|
||||||
if self._hash not in _datafiles:
|
if self._hash not in _datafiles:
|
||||||
@@ -337,7 +337,8 @@ class CoverArtImage:
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise CoverArtImageIOError(e)
|
raise CoverArtImageIOError(e)
|
||||||
|
|
||||||
def _next_filename(self, filename, counters):
|
@staticmethod
|
||||||
|
def _next_filename(filename, counters):
|
||||||
if counters[filename]:
|
if counters[filename]:
|
||||||
new_filename = "%s (%d)" % (decode_filename(filename), counters[filename])
|
new_filename = "%s (%d)" % (decode_filename(filename), counters[filename])
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 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 import log
|
||||||
from distutils.dep_util import newer
|
from distutils.dep_util import newer
|
||||||
@@ -31,15 +34,10 @@ import os
|
|||||||
import re
|
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):
|
def tryint(s):
|
||||||
try:
|
try:
|
||||||
return int(s)
|
return int(s)
|
||||||
except:
|
except BaseException:
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user