chopped line beginnings
introduced check for PIL, if this fails, no image will be output
This commit is contained in:
parent
6ea8623f65
commit
23746e7e78
|
@ -1,7 +1,12 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys,os,pwd,math,re
|
import sys,os,pwd,math,re
|
||||||
#import Image,ImageDraw
|
try:
|
||||||
|
import Image,ImageDraw
|
||||||
|
imageCapability = True
|
||||||
|
except:
|
||||||
|
imageCapability = False
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
releases = {'2010':['linux64',''],
|
releases = {'2010':['linux64',''],
|
||||||
|
@ -276,7 +281,10 @@ def rcbParser(content,size,tolerance,imagename,imagesize,border): # parser for T
|
||||||
myWalk = best['peek']
|
myWalk = best['peek']
|
||||||
myStart = myEnd
|
myStart = myEnd
|
||||||
myEnd = best['point']
|
myEnd = best['point']
|
||||||
|
if myWalk in points[myStart]['segments']:
|
||||||
points[myStart]['segments'].remove(myWalk)
|
points[myStart]['segments'].remove(myWalk)
|
||||||
|
else:
|
||||||
|
sys.stderr.write(str(myWalk)+' not in segments of '+str(myStart))
|
||||||
grainDraw.append(points[myStart]['coords'])
|
grainDraw.append(points[myStart]['coords'])
|
||||||
grainLegs.append(myWalk)
|
grainLegs.append(myWalk)
|
||||||
if innerAngleSum > 0.0:
|
if innerAngleSum > 0.0:
|
||||||
|
@ -701,6 +709,9 @@ parser.set_defaults(mesh = 'dt_planar_trimesh')
|
||||||
if not len(args):
|
if not len(args):
|
||||||
parser.error('no boundary file specified')
|
parser.error('no boundary file specified')
|
||||||
|
|
||||||
|
if not imageCapability:
|
||||||
|
options.imagesize = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
boundaryFile = open(args[0])
|
boundaryFile = open(args[0])
|
||||||
boundarySegments = boundaryFile.readlines()
|
boundarySegments = boundaryFile.readlines()
|
||||||
|
|
Loading…
Reference in New Issue