only complain about missing Mentat release if needed...
This commit is contained in:
parent
34645a7222
commit
dfb791bcaf
|
@ -4,13 +4,6 @@ import sys, os, string, damask
|
||||||
from colorsys import *
|
from colorsys import *
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
|
||||||
|
|
||||||
try:
|
|
||||||
from py_mentat import *
|
|
||||||
except:
|
|
||||||
sys.stderr.write('warning: no valid Mentat release found')
|
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
def readConfig(configFile,ownPath):
|
def readConfig(configFile,ownPath):
|
||||||
|
@ -205,27 +198,27 @@ else:
|
||||||
rgbColors = [ hls_to_rgb(hlsColor[0], hlsColor[1], hlsColor[2])
|
rgbColors = [ hls_to_rgb(hlsColor[0], hlsColor[1], hlsColor[2])
|
||||||
for hlsColor in hlsColors ]
|
for hlsColor in hlsColors ]
|
||||||
|
|
||||||
if options.palette:
|
if options.palette or options.palettef:
|
||||||
for rgb in rgbColors:
|
for rgb in rgbColors:
|
||||||
print '\t'.join(map(lambda x: str(int(255*x)),rgb))
|
print '\t'.join(map(lambda x: {True: str(int(255*x)),
|
||||||
sys.exit(0)
|
False:str( x)}[options.palette],rgb))
|
||||||
if options.palettef:
|
else:
|
||||||
for rgb in rgbColors:
|
|
||||||
print '\t'.join(map(str,rgb))
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
### connect to mentat and change colorMap
|
### connect to mentat and change colorMap
|
||||||
|
sys.path.append(damask.solver.Marc().libraryPath('../../'))
|
||||||
|
try:
|
||||||
|
from py_mentat import *
|
||||||
|
except:
|
||||||
|
sys.stderr.write('error: no valid Mentat release found\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
outputLocals = {}
|
outputLocals = {}
|
||||||
print 'waiting to connect...'
|
print 'waiting to connect...'
|
||||||
py_connect('',options.port)
|
py_connect('',options.port)
|
||||||
print 'connected...'
|
print 'connected...'
|
||||||
|
|
||||||
cmds = colorMap(rgbColors,options.baseIdx)
|
cmds = colorMap(rgbColors,options.baseIdx)
|
||||||
output(['*show_table']+cmds+['*show_model *redraw'],outputLocals,'Mentat')
|
output(['*show_table']+cmds+['*show_model *redraw'],outputLocals,'Mentat')
|
||||||
py_disconnect()
|
py_disconnect()
|
||||||
|
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
output(cmds,outputLocals,'Stdout')
|
output(cmds,outputLocals,'Stdout')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue