3
0
Fork 0

fix: fix 'redefined-argument-from-local' for pylint

This commit is contained in:
Lance Edgar 2025-08-30 16:06:04 -05:00
parent 38e4ce628d
commit 4f6229e5d9
4 changed files with 16 additions and 15 deletions

View file

@ -3,5 +3,6 @@
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable=all disable=all
enable=dangerous-default-value, enable=dangerous-default-value,
redefined-argument-from-local,
unspecified-encoding, unspecified-encoding,
unused-import, unused-import,

View file

@ -285,14 +285,14 @@ class WuttaConfig:
# bring in any "required" files # bring in any "required" files
requires = config.get(f'{self.appname}.config.require') requires = config.get(f'{self.appname}.config.require')
if requires: if requires:
for path in self.parse_list(requires): for p in self.parse_list(requires):
self._load_ini_configs(path, configs, require=True) self._load_ini_configs(p, configs, require=True)
# bring in any "included" files # bring in any "included" files
includes = config.get(f'{self.appname}.config.include') includes = config.get(f'{self.appname}.config.include')
if includes: if includes:
for path in self.parse_list(includes): for p in self.parse_list(includes):
self._load_ini_configs(path, configs, require=False) self._load_ini_configs(p, configs, require=False)
def get_prioritized_files(self): def get_prioritized_files(self):
""" """

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# WuttJamaican -- Base package for Wutta Framework # WuttJamaican -- Base package for Wutta Framework
# Copyright © 2023-2024 Lance Edgar # Copyright © 2023-2025 Lance Edgar
# #
# This file is part of Wutta Framework. # This file is part of Wutta Framework.
# #
@ -652,8 +652,8 @@ class EmailHandler(GenericHandler):
:returns: True if this email type is enabled, otherwise false. :returns: True if this email type is enabled, otherwise false.
""" """
for key in set([key, 'default']): for k in set([key, 'default']):
enabled = self.config.get_bool(f'{self.config.appname}.email.{key}.enabled') enabled = self.config.get_bool(f'{self.config.appname}.email.{k}.enabled')
if enabled is not None: if enabled is not None:
return enabled return enabled
return True return True

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# WuttJamaican -- Base package for Wutta Framework # WuttJamaican -- Base package for Wutta Framework
# Copyright © 2023-2024 Lance Edgar # Copyright © 2023-2025 Lance Edgar
# #
# This file is part of Wutta Framework. # This file is part of Wutta Framework.
# #
@ -256,11 +256,11 @@ def parse_list(value):
parser.whitespace += ',' parser.whitespace += ','
parser.whitespace_split = True parser.whitespace_split = True
values = list(parser) values = list(parser)
for i, value in enumerate(values): for i, val in enumerate(values):
if value.startswith('"') and value.endswith('"'): if val.startswith('"') and val.endswith('"'):
values[i] = value[1:-1] values[i] = val[1:-1]
elif value.startswith("'") and value.endswith("'"): elif val.startswith("'") and val.endswith("'"):
values[i] = value[1:-1] values[i] = val[1:-1]
return values return values
@ -354,8 +354,8 @@ def resource_path(path):
package, filename = path.split(':') package, filename = path.split(':')
ref = files(package) / filename ref = files(package) / filename
with as_file(ref) as path: with as_file(ref) as p:
return str(path) return str(p)
return path return path