PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/rgenetics/rgLDIndep_code.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 25 lines | 16 code | 7 blank | 2 comment | 0 complexity | 696aedb95dd6d1280c945831df2472df MD5 | raw file
 1from galaxy import app
 2import os, string, time
 3
 4def timenow():
 5    """return current time as a string
 6    """
 7    return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time()))
 8
 9
10
11def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
12    name,data = out_data.items()[0]
13    basename = param_dict['title1']
14    killme = string.punctuation + string.whitespace
15    trantab = string.maketrans(killme,'_'*len(killme))
16    title = basename.encode().translate(trantab)
17    info = '%s filtered by rgLDIndep.py at %s' % (title,timenow())
18    data.file_name = data.file_name
19    data.metadata.base_name = title
20    data.name = '%s.pbed' % title
21    data.info = info
22    app.model.context.flush()
23
24
25