fix: fix 'assignment-from-no-return' for pylint
This commit is contained in:
parent
5a6ed6135a
commit
11ec57387e
3 changed files with 12 additions and 5 deletions
|
@ -4,7 +4,6 @@
|
||||||
disable=fixme,
|
disable=fixme,
|
||||||
arguments-differ,
|
arguments-differ,
|
||||||
arguments-renamed,
|
arguments-renamed,
|
||||||
assignment-from-no-return,
|
|
||||||
attribute-defined-outside-init,
|
attribute-defined-outside-init,
|
||||||
consider-using-dict-comprehension,
|
consider-using-dict-comprehension,
|
||||||
consider-using-dict-items,
|
consider-using-dict-items,
|
||||||
|
|
|
@ -918,7 +918,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
if not term:
|
if not term:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
data = self.autocomplete_data(term)
|
data = self.autocomplete_data(term) # pylint: disable=assignment-from-none
|
||||||
if not data:
|
if not data:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def autocomplete_data(self, term):
|
def autocomplete_data(self, term): # pylint: disable=unused-argument
|
||||||
"""
|
"""
|
||||||
Should return the data/query for the "matching" model records,
|
Should return the data/query for the "matching" model records,
|
||||||
based on autocomplete search term. This is called by
|
based on autocomplete search term. This is called by
|
||||||
|
@ -944,6 +944,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
|
|
||||||
:returns: List of data records, or SQLAlchemy query.
|
:returns: List of data records, or SQLAlchemy query.
|
||||||
"""
|
"""
|
||||||
|
return None
|
||||||
|
|
||||||
def autocomplete_normalize(self, obj):
|
def autocomplete_normalize(self, obj):
|
||||||
"""
|
"""
|
||||||
|
@ -1007,13 +1008,13 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
obj = self.get_instance()
|
obj = self.get_instance()
|
||||||
filename = self.request.GET.get("filename", None)
|
filename = self.request.GET.get("filename", None)
|
||||||
|
|
||||||
path = self.download_path(obj, filename)
|
path = self.download_path(obj, filename) # pylint: disable=assignment-from-none
|
||||||
if not path or not os.path.exists(path):
|
if not path or not os.path.exists(path):
|
||||||
return self.notfound()
|
return self.notfound()
|
||||||
|
|
||||||
return self.file_response(path)
|
return self.file_response(path)
|
||||||
|
|
||||||
def download_path(self, obj, filename):
|
def download_path(self, obj, filename): # pylint: disable=unused-argument
|
||||||
"""
|
"""
|
||||||
Should return absolute path on disk, for the given object and
|
Should return absolute path on disk, for the given object and
|
||||||
filename. Result will be used to return a file response to
|
filename. Result will be used to return a file response to
|
||||||
|
@ -1034,6 +1035,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
the :meth:`download()` view will return a 404 not found
|
the :meth:`download()` view will return a 404 not found
|
||||||
response.
|
response.
|
||||||
"""
|
"""
|
||||||
|
return None
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# execute methods
|
# execute methods
|
||||||
|
@ -1305,6 +1307,7 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
Note that their order does not matter since the template
|
Note that their order does not matter since the template
|
||||||
must explicitly define field layout etc.
|
must explicitly define field layout etc.
|
||||||
"""
|
"""
|
||||||
|
return []
|
||||||
|
|
||||||
def configure_gather_settings(
|
def configure_gather_settings(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -1656,6 +1656,11 @@ class TestMasterView(WebTestCase):
|
||||||
count = self.session.query(model.Setting).count()
|
count = self.session.query(model.Setting).count()
|
||||||
self.assertEqual(count, 0)
|
self.assertEqual(count, 0)
|
||||||
|
|
||||||
|
def test_configure_get_simple_settings(self):
|
||||||
|
view = self.make_view()
|
||||||
|
settings = view.configure_get_simple_settings()
|
||||||
|
self.assertEqual(settings, [])
|
||||||
|
|
||||||
def test_configure_gather_settings(self):
|
def test_configure_gather_settings(self):
|
||||||
view = self.make_view()
|
view = self.make_view()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue