Compare commits

..

No commits in common. "f68d56017c09d6e16f50d7e72c7e28c93eb4aee8" and "c8b7d09b41aff0448daea836b1847a3bd1b9932d" have entirely different histories.

4 changed files with 14 additions and 13 deletions

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "tiramisu"
version = "5.2.0a26"
version = "5.2.0a25"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "an options controller tool"

View file

@ -1 +1 @@
__version__ = "5.2.0a26"
__version__ = "5.2.0a25"

View file

@ -39,9 +39,8 @@ TiramisuErrorCode = Literal[
def display_list(
lst,
*,
separator: str="and",
add_quote: bool=False,
sort: bool=True,
separator="and",
add_quote=False,
) -> str():
if not lst:
return '""'
@ -62,13 +61,15 @@ def display_list(
for l in lst:
if not isinstance(l, str):
l = str(l)
lst_.append(_(l))
lst__ = []
for l in lst_:
if add_quote and not l.startswith('"'):
l = '"{}"'.format(l)
lst_.append(_(l))
if sort:
lst_.sort()
last = lst_[-1]
return ", ".join(lst_[:-1]) + _(" {} ").format(separator) + "{}".format(last)
lst__.append(l)
lst__.sort()
last = lst__[-1]
return ", ".join(lst__[:-1]) + _(" {} ").format(separator) + "{}".format(last)
# Exceptions for an Option

View file

@ -28,7 +28,7 @@ FUNCTION_WAITING_FOR_ERROR = []
def function_waiting_for_dict(function):
"""functions (calculation or validation) receive by default only the value of other options
if you use this decoractor, it will recieve a dict with option informations
all functions declared with this function recieve a dict with option informations
(value, name, ...)
"""
name = function.__name__
@ -38,8 +38,8 @@ def function_waiting_for_dict(function):
def function_waiting_for_error(function):
"""functions (calculation or validation) receiven by default, only the value of other options
if you use this decoractor, it will pass PropertyError too
"""functions (calculation or validation) receive by default only the value of other options
set PropertyError too
"""
name = function.__name__
if name not in FUNCTION_WAITING_FOR_ERROR: