The context module¶
The context module defines various context managers used in Rapthor.
Definition of context manager classes
- class rapthor.lib.context.RedirectStdStreams(stdout=None, stderr=None)¶
Context manager used to redirect streams
- Parameters:
- stdoutfile or stream object
stdout stream
- stderrfile or stream object
stderr stream
- class rapthor.lib.context.Timer(log=None, type='operation')¶
Context manager used to time operations
- Parameters:
- loglogging instance
The logging instance to use. If None, root is used
- typestr, optional
Type of operation