This package consists of a collection of useful classes and functions. Most of the elements are taurus independent and can be used generically.
This module contains a python implementation of json. This was done because json only became part of python since version 2.6. The json implementation follows the rule:
- if python >= 2.6 use standard json from python distribution
- otherwise use private implementation distributed with taurus
Modules
Classes
Functions
This function returns a callable weak reference to a callable object. Object can be a callable object, a function or a method.
| Parameters: |
|
|---|---|
| Returns: | a weak reference for the given callable |
| Return type: | BoundMethodWeakref or weakref.ref |
Translates a sequence into a dictionary by converting each to elements of the sequence (k,v) into a k:v pair in the dictionary
| Parameters: | seq (:class:~`sequence`) – any sequence object |
|---|---|
| Return type: | :class:~`dict` |
| Returns: | dictionary built from the given sequence |
This method will print a recursive dict in a tree-like shape:
>>> print getDictAsTree({'A':{'B':[1,2],'C':[3]}})
Finds out user inf (currently just the logged user name) for Windows and Posix machines. sets a USER_NAME variable containing the logged user name defines a UNKNOWN_USER variable to which username falls back.
| Return type: | :class:~`str` |
|---|---|
| Returns: | current user name |
Decorator to simplify the use of property. Like @property for attrs who need more than a getter. For getter only property use @property.
adapted from http://code.activestate.com/recipes/502243/
Decorator to make thread-safe class members Decorator to create thread-safe objects.
Warning