Merge pull request #20483 from Roy-043/Draft-remove-obsolete-param-functions

Draft: remove obsolete param functions
This commit is contained in:
Roy-043
2025-03-27 11:51:16 +01:00
committed by GitHub
2 changed files with 0 additions and 82 deletions

View File

@@ -54,10 +54,6 @@ from draftutils.utils import ARROW_TYPES as arrowtypes
from draftutils.utils import (type_check,
typecheck,
get_param,
getParam,
set_param,
setParam,
precision,
tolerance)

View File

@@ -183,84 +183,6 @@ def type_check(args_and_types, name="?"):
typecheck = type_check
def get_param(param, default=None):
"""Return a parameter value from the current parameter database.
The parameter database is located in the tree
::
'User parameter:BaseApp/Preferences/Mod/Draft'
In the case that `param` is `'linewidth'` or `'color'` it will get
the values from the View parameters
::
'User parameter:BaseApp/Preferences/View/DefaultShapeLineWidth'
'User parameter:BaseApp/Preferences/View/DefaultShapeLineColor'
Parameters
----------
param : str
A string that indicates a parameter in the parameter database.
default : optional
It indicates the default value of the given parameter.
It defaults to `None`, in which case it will use a specific
value depending on the type of parameter determined
with `get_param_type`.
Returns
-------
int, or str, or float, or bool
Depending on `param` and its type.
"""
if param == "linewidth":
return params.get_param("DefaultShapeLineWidth", path="View")
elif param == "color":
return params.get_param("DefaultShapeLineColor", path="View")
else:
return params.get_param(param)
getParam = get_param
def set_param(param, value):
"""Set a Draft parameter with the given value.
The parameter database is located in the tree
::
'User parameter:BaseApp/Preferences/Mod/Draft'
In the case that `param` is `'linewidth'` or `'color'` it will set
the View parameters
::
'User parameter:BaseApp/Preferences/View/DefaultShapeLineWidth'
'User parameter:BaseApp/Preferences/View/DefaultShapeLineColor'
Parameters
----------
param : str
A string that indicates a parameter in the parameter database.
value : int, or str, or float, or bool
The appropriate value of the parameter.
Depending on `param` and its type, determined with `get_param_type`,
it sets the appropriate value by calling `ParameterGrp.SetInt`,
`ParameterGrp.SetString`, `ParameterGrp.SetFloat`,
`ParameterGrp.SetBool`, or `ParameterGrp.SetUnsinged`.
"""
if param == "linewidth":
return params.set_param("DefaultShapeLineWidth", value, path="View")
elif param == "color":
return params.set_param("DefaultShapeLineColor", value, path="View")
else:
return params.set_param(param, value)
setParam = set_param
def precision():
"""Return the precision value from the parameter database.