only complain about missing Mentat release if needed...

This commit is contained in:
Philip Eisenlohr 2012-12-12 08:33:42 +00:00
parent 34645a7222
commit dfb791bcaf
1 changed files with 29 additions and 36 deletions

View File

@ -4,13 +4,6 @@ import sys, os, string, damask
from colorsys import *
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):
@ -205,16 +198,18 @@ else:
rgbColors = [ hls_to_rgb(hlsColor[0], hlsColor[1], hlsColor[2])
for hlsColor in hlsColors ]
if options.palette:
if options.palette or options.palettef:
for rgb in rgbColors:
print '\t'.join(map(lambda x: str(int(255*x)),rgb))
sys.exit(0)
if options.palettef:
for rgb in rgbColors:
print '\t'.join(map(str,rgb))
sys.exit(0)
print '\t'.join(map(lambda x: {True: str(int(255*x)),
False:str( x)}[options.palette],rgb))
else:
### 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 = {}
print 'waiting to connect...'
@ -227,5 +222,3 @@ py_disconnect()
if options.verbose:
output(cmds,outputLocals,'Stdout')