Mercurial > repos > fubar > tool_factory_2
diff getlocalrpackages.py @ 17:a584ff2f7554 draft
Uploaded
author | fubar |
---|---|
date | Sun, 01 Feb 2015 19:46:48 -0500 |
parents | dd6cf2ddaac7 |
children | a11e053d4976 |
line wrap: on
line diff
--- a/getlocalrpackages.py Wed Jan 28 19:28:53 2015 -0500 +++ b/getlocalrpackages.py Sun Feb 01 19:46:48 2015 -0500 @@ -1,5 +1,16 @@ import os import subprocess +import sys + +new_path = [ os.path.join( os.getcwd(), "lib" ) ] +#new_path.extend( sys.path[1:] ) # remove scripts/ from the path +sys.path = new_path +from galaxy import config + +aconfig = config.Configuration( ) +M_A_K = aconfig.master_api_key +print M_A_K + def find_packages(prefix="package_r_"): """ @@ -12,7 +23,10 @@ eprefix = prefix if prefix.find('/') <> -1: eprefix = prefix.replace('/','\/') # for grep - cl = ['locate env.sh | grep -i %s' % eprefix,] + path = '.' + # fails on nitesh's recent mac - locate not working + # cl = ['locate env.sh | grep -i %s' % eprefix,] + cl = ['find %s -iname "env.sh" | grep -i %s' % (path,eprefix),] p = subprocess.Popen(cl, stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True) out, err = p.communicate() fpaths = out.split('\n')