From 04d48c79b916adc45376dbff9e5d70b64df21040 Mon Sep 17 00:00:00 2001 From: Mahesh Balasubramaniam Date: Tue, 29 Jan 2013 15:31:01 +0000 Subject: [PATCH] symlink_Code.py split seperately from the previous setup_code.py --- code/setup/symlink_Code.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 code/setup/symlink_Code.py diff --git a/code/setup/symlink_Code.py b/code/setup/symlink_Code.py new file mode 100644 index 000000000..c92a1ac54 --- /dev/null +++ b/code/setup/symlink_Code.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +import os,string,re,damask + +bin_link = { \ + '.' : [ + 'DAMASK_spectral.exe', + ], + } + +damaskEnv = damask.Environment('../../') # script location relative to root +baseDir = damaskEnv.relPath('code/') + +for dir in bin_link: + for file in bin_link[dir]: + print baseDir + print dir + print file + src = os.path.abspath(os.path.join(baseDir,dir,file)) + print src + os.path.exists(src) + if os.path.exists(src): + sym_link = os.path.abspath(os.path.join(damaskEnv.binDir(),\ + {True: dir, + False:os.path.splitext(file)[0]}[file == ''])) + if os.path.lexists(sym_link): + os.remove(sym_link) + os.symlink(src,sym_link) + print sym_link,'-->',src