improved symbolic linking and replace deprecated print syntax

This commit is contained in:
Martin Diehl 2014-04-29 14:43:04 +00:00
parent 6a71cf672c
commit 2346a0841e
2 changed files with 9 additions and 8 deletions

View File

@ -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')

View File

@ -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')