fix: fix 'unused-variable' for pylint
This commit is contained in:
parent
8987197856
commit
2c2d35554f
9 changed files with 8 additions and 11 deletions
|
@ -11,3 +11,4 @@ enable=
|
||||||
too-many-instance-attributes,
|
too-many-instance-attributes,
|
||||||
too-many-return-statements,
|
too-many-return-statements,
|
||||||
unused-import,
|
unused-import,
|
||||||
|
unused-variable,
|
||||||
|
|
|
@ -182,7 +182,7 @@ def main(global_config, **settings):
|
||||||
``poser.web.app:main``), similar to this one but with additional
|
``poser.web.app:main``), similar to this one but with additional
|
||||||
views and other config.
|
views and other config.
|
||||||
"""
|
"""
|
||||||
wutta_config = make_wutta_config(settings)
|
wutta_config = make_wutta_config(settings) # pylint: disable=unused-variable
|
||||||
pyramid_config = make_pyramid_config(settings)
|
pyramid_config = make_pyramid_config(settings)
|
||||||
|
|
||||||
pyramid_config.include("wuttaweb.static")
|
pyramid_config.include("wuttaweb.static")
|
||||||
|
|
|
@ -870,7 +870,6 @@ class Form: # pylint: disable=too-many-instance-attributes
|
||||||
generating it automatically if necessary.
|
generating it automatically if necessary.
|
||||||
"""
|
"""
|
||||||
if not hasattr(self, "deform_form"):
|
if not hasattr(self, "deform_form"):
|
||||||
model = self.app.model
|
|
||||||
schema = self.get_schema()
|
schema = self.get_schema()
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
|
||||||
|
|
|
@ -383,7 +383,6 @@ class ObjectRef(colander.SchemaType):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# fetch object from DB
|
# fetch object from DB
|
||||||
model = self.app.model
|
|
||||||
obj = None
|
obj = None
|
||||||
if isinstance(value, _uuid.UUID):
|
if isinstance(value, _uuid.UUID):
|
||||||
obj = self.session.get(self.model_class, value)
|
obj = self.session.get(self.model_class, value)
|
||||||
|
@ -606,7 +605,7 @@ class Permissions(WuttaSet):
|
||||||
|
|
||||||
if "values" not in kwargs:
|
if "values" not in kwargs:
|
||||||
values = []
|
values = []
|
||||||
for gkey, group in self.permissions.items():
|
for group in self.permissions.values():
|
||||||
for pkey, perm in group["perms"].items():
|
for pkey, perm in group["perms"].items():
|
||||||
values.append((pkey, perm["label"]))
|
values.append((pkey, perm["label"]))
|
||||||
kwargs["values"] = values
|
kwargs["values"] = values
|
||||||
|
|
|
@ -467,7 +467,7 @@ class PermissionsWidget(WuttaCheckboxChoiceWidget):
|
||||||
|
|
||||||
if "values" not in kw:
|
if "values" not in kw:
|
||||||
values = []
|
values = []
|
||||||
for gkey, group in self.permissions.items():
|
for group in self.permissions.values():
|
||||||
for pkey, perm in group["perms"].items():
|
for pkey, perm in group["perms"].items():
|
||||||
values.append((pkey, perm["label"]))
|
values.append((pkey, perm["label"]))
|
||||||
kw["values"] = values
|
kw["values"] = values
|
||||||
|
|
|
@ -605,7 +605,7 @@ def make_json_safe(value, key=None, warn=True):
|
||||||
# ensure JSON-compatibility, warn if problems
|
# ensure JSON-compatibility, warn if problems
|
||||||
try:
|
try:
|
||||||
json.dumps(value)
|
json.dumps(value)
|
||||||
except TypeError as error:
|
except TypeError:
|
||||||
if warn:
|
if warn:
|
||||||
prefix = "value"
|
prefix = "value"
|
||||||
if key:
|
if key:
|
||||||
|
|
|
@ -285,8 +285,8 @@ class RoleView(MasterView):
|
||||||
available = self.wutta_permissions
|
available = self.wutta_permissions
|
||||||
permissions = form.validated["permissions"]
|
permissions = form.validated["permissions"]
|
||||||
|
|
||||||
for gkey, group in available.items():
|
for group in available.values():
|
||||||
for pkey, perm in group["perms"].items():
|
for pkey in group["perms"]:
|
||||||
if pkey in permissions:
|
if pkey in permissions:
|
||||||
auth.grant_permission(role, pkey)
|
auth.grant_permission(role, pkey)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -156,7 +156,7 @@ class AppInfoView(MasterView):
|
||||||
return self.config.get(f"wuttaweb.{key}")
|
return self.config.get(f"wuttaweb.{key}")
|
||||||
|
|
||||||
weblibs = self.get_weblibs()
|
weblibs = self.get_weblibs()
|
||||||
for key, title in weblibs.items():
|
for key in weblibs:
|
||||||
|
|
||||||
simple_settings.append(
|
simple_settings.append(
|
||||||
{
|
{
|
||||||
|
|
|
@ -175,7 +175,6 @@ class UserView(MasterView):
|
||||||
|
|
||||||
def objectify(self, form): # pylint: disable=empty-docstring
|
def objectify(self, form): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
model = self.app.model
|
|
||||||
auth = self.app.get_auth_handler()
|
auth = self.app.get_auth_handler()
|
||||||
data = form.validated
|
data = form.validated
|
||||||
|
|
||||||
|
@ -272,7 +271,6 @@ class UserView(MasterView):
|
||||||
|
|
||||||
:rtype: :class:`~wuttaweb.grids.base.Grid`
|
:rtype: :class:`~wuttaweb.grids.base.Grid`
|
||||||
"""
|
"""
|
||||||
model = self.app.model
|
|
||||||
route_prefix = self.get_route_prefix()
|
route_prefix = self.get_route_prefix()
|
||||||
|
|
||||||
grid = self.make_grid(
|
grid = self.make_grid(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue