From 63434c2ddb52acfa94db69d76dd295d0d9b12e25 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 9 Feb 2015 08:57:14 +0000 Subject: [PATCH] corrected error checking for correct type --- processing/post/addEuclideanDistance.py | 6 +++--- processing/pre/geom_fromEuclideanDistance.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/processing/post/addEuclideanDistance.py b/processing/post/addEuclideanDistance.py index 417308343..e3eda963e 100755 --- a/processing/post/addEuclideanDistance.py +++ b/processing/post/addEuclideanDistance.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: UTF-8 no BOM -*- -import os,sys,string,re,math +import os,sys,string,re,math,itertools import numpy as np from scipy import ndimage from optparse import OptionParser @@ -107,8 +107,8 @@ parser.set_defaults(scale = 1.0) (options,filenames) = parser.parse_args() if len(options.type) == 0: parser.error('please select a feature type') -if not set(options.type).issubset(set(map(lambda x: x['name'],features))): - parser.error('type must be chosen from (%s)...'%(', '.join(map(lambda x:', '.join([x['name']]),features)))) +if not set(options.type).issubset(set(list(itertools.chain(*map(lambda x: x['names'],features))))): + parser.error('type must be chosen from (%s)...'%(', '.join(map(lambda x:'|'.join(x['names']),features))) ) if 'biplane' in options.type and 'boundary' in options.type: parser.error("please select only one alias for 'biplane' and 'boundary'") diff --git a/processing/pre/geom_fromEuclideanDistance.py b/processing/pre/geom_fromEuclideanDistance.py index 36e224873..138c9316b 100755 --- a/processing/pre/geom_fromEuclideanDistance.py +++ b/processing/pre/geom_fromEuclideanDistance.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: UTF-8 no BOM -*- -import os,sys,string,re,math +import os,sys,string,re,math,itertools import numpy as np from scipy import ndimage from optparse import OptionParser