ATLAS Offline Software
Loading...
Searching...
No Matches
python.jo_proxy Namespace Reference

Functions

 get_immediate_subdirectories (a_dir)
 mk_jo_proxy (targetbasepath, pkgname, proxypath, addtosearch=True)

Function Documentation

◆ get_immediate_subdirectories()

python.jo_proxy.get_immediate_subdirectories ( a_dir)

Definition at line 6 of file jo_proxy.py.

6def get_immediate_subdirectories(a_dir):
7 return [name for name in os.listdir(a_dir)
8 if os.path.isdir(os.path.join(a_dir, name))]
9

◆ mk_jo_proxy()

python.jo_proxy.mk_jo_proxy ( targetbasepath,
pkgname,
proxypath,
addtosearch = True )

Definition at line 10 of file jo_proxy.py.

10def mk_jo_proxy(targetbasepath, pkgname, proxypath, addtosearch=True):
11 "Make a JO proxy dir such that the MCxxJobOptions/dddd dirs contents are found via include(MCxxJobOptions/yyyy)"
12 if proxypath:
13 if os.path.exists(proxypath):
14 shutil.rmtree(proxypath)
15 os.mkdir(proxypath)
16 os.environ['LOCAL_INSTALL_DIR'] = (os.environ['JOBOPTSEARCHPATH']).split(":")[0]
17 os.environ['LOCAL_DATA_DIR'] = (os.environ['DATAPATH']).split(":")[0]
18
19 dirlist = get_immediate_subdirectories(targetbasepath)
20 subdirlist=dirlist
21 for dd in (dirlist):
22 if (('.svn' not in dd) and ('cmt' not in dd) and ('_joproxy' not in dd)):
23 deepdir = os.path.join(targetbasepath, dd)
24 subdirlist1 = get_immediate_subdirectories(deepdir)
25 subdirlist = subdirlist+["%s" % dd+"/%s" % item for item in subdirlist1]
26 for d in (subdirlist):
27 # TODO: we could _maybe_ add the appropriate share/DSIDxxxx/ dir to the path based on the jobConfig arg... too much magic?
28 if (('.svn' not in d) and ('cmt' not in d) and ('_joproxy' not in d) and ('share/' not in d)):
29 dpath = os.path.join(proxypath, d)
30 if proxypath:
31 os.mkdir(dpath)
32
33 if ('nonStandard' in dpath):
34 dpath_ex = os.path.join(dpath,pkgname)
35 if proxypath:
36 os.mkdir(dpath_ex)
37
38 os.symlink(os.path.join(targetbasepath, d), os.path.join(dpath_ex, "nonStandard"))
39 else :
40 os.symlink(os.path.join(targetbasepath, d), os.path.join(dpath, pkgname))
41 if addtosearch:
42 os.environ["JOBOPTSEARCHPATH"] = dpath+":"+os.environ["JOBOPTSEARCHPATH"]
43 os.environ["DATAPATH"] =os.path.join(targetbasepath, d)+":"+os.environ["DATAPATH"]
44
45 os.environ["JOBOPTSEARCHPATH"] = os.environ['LOCAL_INSTALL_DIR']+":"+os.environ["JOBOPTSEARCHPATH"]
46 os.environ["DATAPATH"] = os.environ['LOCAL_DATA_DIR']+":"+os.environ["DATAPATH"]
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177