From 2346a0841efa0ceb877c2f7947d304c85bf21814 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 29 Apr 2014 14:43:04 +0000 Subject: [PATCH] improved symbolic linking and replace deprecated print syntax --- installation/symlink_Code.py | 9 +++++---- installation/symlink_Processing.py | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index ec335019f..4fec25b2e 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: UTF-8 no BOM -*- -import os +import os,sys import damask bin_link = { \ @@ -35,7 +35,7 @@ for dir in bin_link: 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 + sys.stdout.write(sym_link+' -> '+src+'\n') for version in MarcReleases: @@ -43,5 +43,6 @@ for version in MarcReleases: if os.path.exists(src): sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc'+str(version)+'.f90')) if os.path.lexists(sym_link): os.remove(sym_link) - os.symlink(src,sym_link) - print sym_link,'-->',src + os.symlink(os.path.relpath(src,baseDir),sym_link) + sys.stdout.write(sym_link+' -> '+src+'\n') + diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index d8a546ada..978cc044a 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -2,7 +2,7 @@ # -*- coding: UTF-8 no BOM -*- # Makes postprocessing routines acessible from everywhere. -import os +import os,sys from damask import Environment BOLD = '\033[1m' @@ -34,9 +34,9 @@ for subDir in processing_subDirs: if os.path.lexists(sym_link): os.remove(sym_link) - print sym_link, + sys.stdout.write(sym_link) else: - print BOLD + sym_link + ENDC, + sys.stdout.write(BOLD + sym_link + ENDC) os.symlink(src,sym_link) - print '-->',src + sys.stdout.write(' -> '+src+'\n')