moduleutils
Utility fuctions to support smart modules.
Functions
copy_func(func, func_name, doc_string=None, arg_list=None)
Copy a function object to create a new function.
This is used inside smart modules that auto-generate functions based on context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
object
|
python source function object |
required |
func_name |
str
|
new function name |
required |
doc_string |
str
|
new function docstring |
None
|
arg_list |
list
|
list of default values for function arguments |
None
|
Returns:
Type | Description |
---|---|
object
|
new python function objects |
Source code in pyrevitlib/pyrevit/coreutils/moduleutils.py
mark(prop_name)
Decorator function to add a marker property to the given type.
collect_marked(module_obj, prop_name)
Collect module objects that are marked with given property.
Source code in pyrevitlib/pyrevit/coreutils/moduleutils.py
has_argument(function_obj, arg_name)
Check if given function object has argument matching arg_name.
has_any_arguments(function_obj, arg_name_list)
Check if given function object has any of given arguments.
Source code in pyrevitlib/pyrevit/coreutils/moduleutils.py
filter_kwargs(function_obj, kwargs)
Filter given arguments dict for function_obj arguments.