removed (now) unused function for reading of configFile
This commit is contained in:
parent
2784a96a51
commit
837574278e
|
@ -1,30 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys, os, string
|
import sys, string
|
||||||
import damask
|
import damask
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
|
||||||
def readConfig(configFile,ownPath):
|
|
||||||
config = {}
|
|
||||||
configDir = os.path.split(os.path.realpath(ownPath))[0]
|
|
||||||
filename = os.path.join(configDir,configFile)
|
|
||||||
if os.path.isfile(filename):
|
|
||||||
file = open(filename)
|
|
||||||
for line in file.readlines():
|
|
||||||
if not line.startswith('#'):
|
|
||||||
item = line.split()
|
|
||||||
for name in item[0].split('|'):
|
|
||||||
config[name] = {}
|
|
||||||
config[name]['left'] = map(float,item[1].split(','))
|
|
||||||
config[name]['right'] = map(float,item[2].split(','))
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
def outMentat(cmd,locals):
|
def outMentat(cmd,locals):
|
||||||
if cmd[0:3] == '(!)':
|
if cmd[0:3] == '(!)':
|
||||||
|
@ -130,12 +110,12 @@ else:
|
||||||
theMap = damask.Colormap(damask.Color('HSL',left),damask.Color('HSL',right))
|
theMap = damask.Colormap(damask.Color('HSL',left),damask.Color('HSL',right))
|
||||||
if options.inverse:
|
if options.inverse:
|
||||||
theMap = theMap.invert()
|
theMap = theMap.invert()
|
||||||
theColors = theMap.export(format='list',steps=options.colorcount)
|
|
||||||
|
|
||||||
if options.palette or options.palettef:
|
if options.palettef:
|
||||||
for theColor in theColors:
|
print theMap.export(format='raw',steps=options.colorcount)
|
||||||
print '\t'.join(map(lambda x: {True: str( x),
|
elif options.palette:
|
||||||
False:str(int(255*x))}[options.palettef],theColor))
|
for theColor in theMap.export(format='list',steps=options.colorcount):
|
||||||
|
print '\t'.join(map(lambda x: str(int(255*x)),theColor))
|
||||||
else:
|
else:
|
||||||
### connect to mentat and change colorMap
|
### connect to mentat and change colorMap
|
||||||
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
||||||
|
@ -150,7 +130,7 @@ else:
|
||||||
mentat = False
|
mentat = False
|
||||||
|
|
||||||
outputLocals = {}
|
outputLocals = {}
|
||||||
cmds = colorMap(theColors,options.baseIdx)
|
cmds = colorMap(theMap.export(format='list',steps=options.colorcount),options.baseIdx)
|
||||||
if mentat:
|
if mentat:
|
||||||
output(['*show_table']+cmds+['*show_model *redraw'],outputLocals,'Mentat')
|
output(['*show_table']+cmds+['*show_model *redraw'],outputLocals,'Mentat')
|
||||||
py_disconnect()
|
py_disconnect()
|
||||||
|
|
Loading…
Reference in New Issue