fix bug pwidth, pheight are floats

This commit is contained in:
Diogo Sousa
2023-02-01 13:01:00 +00:00
parent 104f929b45
commit 20bc8ae2bf
3 changed files with 5 additions and 1 deletions

View File

@@ -119,6 +119,8 @@ def get_var_diff(obj, name, value):
cast_value = strtobool(value)
elif isinstance(getattr(obj, name), int):
cast_value = int(value)
elif isinstance(getattr(obj, name), float):
cast_value = float(value)
else:
cast_value = value

View File

@@ -170,6 +170,8 @@ def cast_set_attr(obj, name, value):
setattr(obj, name, strtobool(value))
elif isinstance(getattr(obj, name), int):
setattr(obj, name, int(value))
elif isinstance(getattr(obj, name), float):
setattr(obj, name, float(value))
else:
setattr(obj, name, value)

View File

@@ -315,7 +315,7 @@ class SettingsController(BaseController):
parser.add_argument(
"-v",
"--value",
type=int,
type=float,
dest="value",
help="value",
)