imap_storage.tools package

Submodules

imap_storage.tools.compare module

compare tool

imap_storage.tools.compare.list_compare(old, new)[source]

compare

imap_storage.tools.timer module

@timer decorator

class imap_storage.tools.timer.LogEntry(func, duration, result, *args, **kwargs)[source]

Bases: object

Class that represents a Log entry

MODES = ('test', 'wsgi', 'main', 'django')
args

parse args :returns: args as list of strings

static choose_mode()[source]

possible_modes ‘test’, ‘wsgi’, ‘main’, ‘django’ :returns: mode as string

kwargs_list(short=False)[source]

parse kwargs :param truncate: should the output of values be shortened? :returns: kwargs as list of strings

kwargs_long

kwargs as long version

kwargs_short

kwargs as short version

long(with_result=False)[source]

long version of the log message :param with_result: append function result to log :type with_result: bool, optional

Returns:log entry
Return type:str
short(with_result=False)[source]

short version of the log message :param with_result: append function result to log :type with_result: bool, optional

Returns:log entry
Return type:str
static shorten_string(text_str, max_chars=50, replace=' <...> ')[source]

shorten a text string to maximal ammount of chars :param text_str: string to shorten :param max_chars: (optional) limit text_str to these ammount of chars :param replace: (optional) replace cutted with this string

to_string(short=False, with_result=False)[source]

creates the string to enter in logs

Parameters:
  • short (bool, optional) – use short version
  • with_result (bool, optional) – append result of function call to log
Returns:

log entry as string

Return type:

str

imap_storage.tools.timer.timer(func)[source]

@timer decorator :TODO: option to shorten args at output

Module contents