can now be executed from different directories...but will operate on "its" one
This commit is contained in:
parent
3f41b271fb
commit
02602144d2
|
@ -2,19 +2,18 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
import os,sys
|
import os,sys
|
||||||
|
|
||||||
sys.argv += ['' for i in range(2 - len(sys.argv))]
|
|
||||||
architectures = {
|
architectures = {
|
||||||
'marc': {
|
'marc': {
|
||||||
'parent': 'mpie_cpfem_marc.f90',
|
'parent': 'mpie_cpfem_marc.f90',
|
||||||
'versions' : ['%%MARCVERSION%%','2007r1','2008r1'],
|
'versions' : ['%%MARCVERSION%%','2007r1','2008r1'],
|
||||||
'substitutions' : {'%%REVISION%%': sys.argv[1],},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wd = os.path.dirname(sys.argv[0])
|
||||||
for arch in architectures:
|
for arch in architectures:
|
||||||
me = architectures[arch]
|
me = architectures[arch]
|
||||||
try:
|
try:
|
||||||
parentFile = open(me['parent'])
|
parentFile = open(wd+os.sep+me['parent'])
|
||||||
parentContent = parentFile.readlines()
|
parentContent = parentFile.readlines()
|
||||||
parentFile.close()
|
parentFile.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
|
@ -23,9 +22,7 @@ for arch in architectures:
|
||||||
|
|
||||||
|
|
||||||
for version in me['versions'][1:]:
|
for version in me['versions'][1:]:
|
||||||
childFile = open(version.join(os.path.splitext(me['parent'])),'w')
|
childFile = open(wd+os.sep+version.join(os.path.splitext(me['parent'])),'w')
|
||||||
for line in parentContent:
|
for line in parentContent:
|
||||||
for substitution in me['substitutions']:
|
|
||||||
line = line.replace(substitution,me['substitutions'][substitution])
|
|
||||||
childFile.write(line.replace(me['versions'][0],version))
|
childFile.write(line.replace(me['versions'][0],version))
|
||||||
childFile.close()
|
childFile.close()
|
||||||
|
|
Loading…
Reference in New Issue