Exscript.util.impl module¶
Development tools.
-
Exscript.util.impl.
add_label
(obj, name, **kwargs)[source]¶ Labels an object such that it can later be checked with
get_label()
.Parameters: - obj (object) – The object that is labeled.
- name (str) – A label.
- kwargs (dict) – Optional values to store with the label.
Return type: object
Returns: The labeled function.
-
Exscript.util.impl.
copy_labels
(src, dst)[source]¶ Copies all labels of one object to another object.
Parameters: - src (object) – The object to check read the labels from.
- dst (object) – The object into which the labels are copied.
-
Exscript.util.impl.
debug
(func)[source]¶ Decorator that prints a message whenever a function is entered or left.
-
Exscript.util.impl.
deprecated
(func)[source]¶ A decorator for marking functions as deprecated. Results in a printed warning message when the function is used.
-
Exscript.util.impl.
format_exception
(thetype, ex, tb)[source]¶ This function is a drop-in replacement for Python’s traceback.format_exception().
Since traceback objects can not be pickled, Exscript is forced to manipulate them before they are passed accross process boundaries. This leads to the fact the Python’s traceback.format_exception() no longer works for those objects.
This function works with any traceback object, regardless of whether or not Exscript manipulated it.
-
Exscript.util.impl.
get_label
(obj, name)[source]¶ Checks whether an object has the given label attached (see
add_label()
) and returns the associated options.Parameters: - obj (object) – The object to check for the label.
- name (str) – A label.
Return type: dict or None
Returns: The optional values if the label is attached, None otherwise.
-
Exscript.util.impl.
serializeable_exc_info
(thetype, ex, tb)[source]¶ Since traceback objects can not be pickled, this function manipulates exception info tuples before they are passed accross process boundaries.