thepipe.tools
¶
Manipulating time and so…
Module Contents¶
-
class
thepipe.tools.
Timer
(message='It', precision=3, callback=print)[source]¶ A very simple, accurate and easy to use timer context
-
class
thepipe.tools.
Cuckoo
(interval=0, callback=print)[source]¶ A timed callback caller, which only executes once in a given interval.
-
thepipe.tools.
ignored
(*exceptions)[source]¶ Ignore-context for a given list of exceptions.
- Example:
- with ignored(AttributeError):
foo.a = 1
-
thepipe.tools.
colored
(text, color=None, on_color=None, attrs=None, ansi_code=None)[source]¶ Colorize text, while stripping nested ANSI color sequences.
Author: Konstantin Lepa <konstantin.lepa@gmail.com> / termcolor
- Available text colors:
red, green, yellow, blue, magenta, cyan, white.
- Available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
- Available attributes:
bold, dark, underline, blink, reverse, concealed.
- Example:
colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’]) colored(‘Hello, World!’, ‘green’)
-
thepipe.tools.
cprint
(text, color=None, on_color=None, attrs=None)[source]¶ Print colorize text.
Author: Konstantin Lepa <konstantin.lepa@gmail.com> / termcolor
It accepts arguments of print function.