fix: fix 'no-else-return' for pylint
This commit is contained in:
parent
6ac1cacdb3
commit
e845c66d86
4 changed files with 16 additions and 16 deletions
|
@ -12,6 +12,7 @@ enable=anomalous-backslash-in-string,
|
||||||
empty-docstring,
|
empty-docstring,
|
||||||
inconsistent-return-statements,
|
inconsistent-return-statements,
|
||||||
invalid-name,
|
invalid-name,
|
||||||
|
no-else-return,
|
||||||
redefined-argument-from-local,
|
redefined-argument-from-local,
|
||||||
too-few-public-methods,
|
too-few-public-methods,
|
||||||
trailing-whitespace,
|
trailing-whitespace,
|
||||||
|
|
|
@ -88,30 +88,29 @@ class UUID(sa.types.TypeDecorator):
|
||||||
""" """
|
""" """
|
||||||
if dialect.name == "postgresql":
|
if dialect.name == "postgresql":
|
||||||
return dialect.type_descriptor(PGUUID())
|
return dialect.type_descriptor(PGUUID())
|
||||||
else:
|
return dialect.type_descriptor(sa.CHAR(32))
|
||||||
return dialect.type_descriptor(sa.CHAR(32))
|
|
||||||
|
|
||||||
def process_bind_param(self, value, dialect): # pylint: disable=empty-docstring
|
def process_bind_param(self, value, dialect): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if value is None:
|
if value is None:
|
||||||
return value
|
return value
|
||||||
elif dialect.name == "postgresql":
|
|
||||||
|
if dialect.name == "postgresql":
|
||||||
return str(value)
|
return str(value)
|
||||||
else:
|
|
||||||
if not isinstance(value, _uuid.UUID):
|
if not isinstance(value, _uuid.UUID):
|
||||||
return "%.32x" % _uuid.UUID(value).int
|
return "%.32x" % _uuid.UUID(value).int
|
||||||
else:
|
|
||||||
# hexstring
|
# hexstring
|
||||||
return "%.32x" % value.int
|
return "%.32x" % value.int
|
||||||
|
|
||||||
def process_result_value(self, value, dialect): # pylint: disable=unused-argument,empty-docstring
|
def process_result_value(self, value, dialect): # pylint: disable=unused-argument,empty-docstring
|
||||||
""" """
|
""" """
|
||||||
if value is None:
|
if value is None:
|
||||||
return value
|
return value
|
||||||
else:
|
if not isinstance(value, _uuid.UUID):
|
||||||
if not isinstance(value, _uuid.UUID):
|
value = _uuid.UUID(value)
|
||||||
value = _uuid.UUID(value)
|
return value
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def uuid_column(*args, **kwargs):
|
def uuid_column(*args, **kwargs):
|
||||||
|
|
|
@ -558,9 +558,9 @@ class InstallHandler(GenericHandler):
|
||||||
if is_bool:
|
if is_bool:
|
||||||
if text == '':
|
if text == '':
|
||||||
return default
|
return default
|
||||||
elif text.upper() == 'Y':
|
if text.upper() == 'Y':
|
||||||
return True
|
return True
|
||||||
elif text.upper() == 'N':
|
if text.upper() == 'N':
|
||||||
return False
|
return False
|
||||||
self.rprint("\n\t[bold yellow]ambiguous, please try again[/bold yellow]\n")
|
self.rprint("\n\t[bold yellow]ambiguous, please try again[/bold yellow]\n")
|
||||||
return self.prompt_generic(info, default, is_bool=True)
|
return self.prompt_generic(info, default, is_bool=True)
|
||||||
|
|
|
@ -84,7 +84,7 @@ class PeopleHandler(GenericHandler):
|
||||||
person = obj
|
person = obj
|
||||||
return person
|
return person
|
||||||
|
|
||||||
elif isinstance(obj, model.User):
|
if isinstance(obj, model.User):
|
||||||
user = obj
|
user = obj
|
||||||
if user.person:
|
if user.person:
|
||||||
return user.person
|
return user.person
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue