chopped line beginnings

introduced check for PIL, if this fails, no image will be output
This commit is contained in:
Philip Eisenlohr 2010-09-23 07:59:52 +00:00
parent 6ea8623f65
commit 23746e7e78
1 changed files with 610 additions and 599 deletions

View File

@ -1,7 +1,12 @@
#!/usr/bin/env python
import sys,os,pwd,math,re
#import Image,ImageDraw
try:
import Image,ImageDraw
imageCapability = True
except:
imageCapability = False
from optparse import OptionParser
releases = {'2010':['linux64',''],
@ -276,7 +281,10 @@ def rcbParser(content,size,tolerance,imagename,imagesize,border): # parser for T
myWalk = best['peek']
myStart = myEnd
myEnd = best['point']
if myWalk in points[myStart]['segments']:
points[myStart]['segments'].remove(myWalk)
else:
sys.stderr.write(str(myWalk)+' not in segments of '+str(myStart))
grainDraw.append(points[myStart]['coords'])
grainLegs.append(myWalk)
if innerAngleSum > 0.0:
@ -701,6 +709,9 @@ parser.set_defaults(mesh = 'dt_planar_trimesh')
if not len(args):
parser.error('no boundary file specified')
if not imageCapability:
options.imagesize = 0
try:
boundaryFile = open(args[0])
boundarySegments = boundaryFile.readlines()