some clean up of the code
Dieser Commit ist enthalten in:
Ursprung
c8d7d4e286
Commit
144ffc72a5
1 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
|
@ -23,9 +23,9 @@ def wrap_func(func, **updates):
|
|||
def wrapper(*args, **kwargs):
|
||||
return func(*args, **kwargs)
|
||||
|
||||
attrs = frozenset(
|
||||
('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__')
|
||||
) - frozenset(updates.keys())
|
||||
attrs = set(('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__')).difference(
|
||||
updates.keys()
|
||||
)
|
||||
for attr in attrs:
|
||||
try:
|
||||
value = getattr(func, attr)
|
||||
|
@ -90,6 +90,7 @@ class meta(type):
|
|||
|
||||
class Types(metaclass=meta):
|
||||
|
||||
@staticmethod
|
||||
def list( # type: ignore[misc]
|
||||
elements: Union[Type[object], str, AnsibleParameter],
|
||||
required: bool = False,
|
||||
|
@ -120,6 +121,7 @@ class Types(metaclass=meta):
|
|||
option["description"] = help.split("\n")
|
||||
return option
|
||||
|
||||
@staticmethod
|
||||
def dict(required: bool = False, help: Optional[str] = None, **options: AnsibleParameter) -> AnsibleParameter: # type: ignore[misc]
|
||||
"""Wrapper for the Ansible dict type
|
||||
|
||||
|
@ -154,6 +156,7 @@ def modspec(
|
|||
supports_check_mode: bool = False,
|
||||
add_file_common_args: bool = False,
|
||||
) -> Dict[str, Any]: # pragma: nocover
|
||||
"""Wrapper to properly Type the module specs"""
|
||||
return dict(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive=mutually_exclusive,
|
||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren