Define various tools used by the pipe engine.
Hash object using the crc32 algorithm.
Create an empty pipe environment including main, defaulf segment, prefix and log directories.
This function is called from the script pipeutils.
this generator flattens nested containers such as
>>> l=( ('John', 'Hunter'), (1,23), [[[[42,(5,23)]]]])
>>> for i in flatten(l): print i,
John Hunter 1 23 42 5 23
By: Composite of Holger Krekel and Luther Blissett From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/121294 and Recipe 1.12 in cookbook
Return a unique key which identify code string using cheksum algorithm.
Comment lines and blanks are not taken into account in code string.
>>> print(get_hashkey("a = 5", 0).base32_digest())
ZNBR63A
Return log file name
Current date time is prepend to the log file name.
Check wether the file is a python code file based an the file extension.
Convert a list into a dict keeping duplicated entries.
>>> d = make_dict(zip(['a']*10+['b'], range(10)+[1]))
>>> print d
{'a': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'b': 1}
Return a code string with some part of the non syntactic information removed.
if unsafe is True remove some syntactic information like spaces in string literals.
>>> print reduced_code_formatting('''def pouet():
... #lets try it
... a, b = foo ( bar )
... ''')
def pouet():
a, b = foo ( bar )
Return a string representation of the date time now %y/%m/%d %H:%M:%s
Object string representation with special caracters replaced.
>>> str_file((1,))
'1_'
String representation without the quotes and spaces that disturbs the web interface.
>>> print(str_web(['a', ' b']))
[a,b]
Upgrade pipeweb config with new convention.
Use .pipelet directory for all config/log files
Add new tag to the database
Check that the tag do not exist yet for this id
Update the data root path in the database.
Delete a tasks instances.
Delete all products directories of a tasks instance.
Return the last computed segment in a given database.
Return a seg-id
Return the list of existing dates
Date strings are picked from queued_on field corresponding to the first task of each segment.