private.utils¶
Uncategorised utilities.
This is a mess of stuff, which should get tidied up in the short term.
Module Members¶
addProjectSourceToSysPath()
addThisProjectSourceToSysPath()
dumpStack()
findFileAbove()
getCallerDict()
trimLines()
trimText()
Classes¶
-
class
private.utils.
Partial
(func, *args, **kwargs)¶ Enhanced form of functools.partial.
This allows the arguments to be modified, using
update()
, before the partial function is invoked.-
update
(*args, **kwargs) Add positional args and/or modify keyword args.
Arguments
- args
- All positional arguments are added to the existing set. Some cases may make use of positional arguments, but mostly only keyword args are provided.
- kwargs
- All keyword arguments are used to update the existing set.
-
-
class
private.utils.
preserveCWD
¶ Context manager to undo and os.chdir calls.
The current working directory in effect before context entry is restored when the context exits.
Subclass:
temporaryCWD
-
class
private.utils.
temporaryCWD
(targetDirectory)¶ Context manager to temporarily change the current working directory.
The CWD is chaged when the context is entered. The current working directory in effect before context entry is restored when the context exits.
Base class:
preserveCWD