Commit 042aa10a authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add missing generator for Sequence combinations

parent c690f77e
......@@ -123,11 +123,10 @@ def compute_choice_combinations(asn1_ty, pool):
def compute_sequence_combinations(asn1_ty, pool):
''' Generator returning all combinations of SEQUENCE types '''
elems = []
for name, value_ty in asn1_ty.Children.viewitems():
# Create a list of iterables
elems.append(compute_combinations(value_ty, pool))
# Generator with all combinations
# Prepare generators to compute combinations of each field
elems = (compute_combinations(sort, pool)
for sort in asn1_ty.Children.viewvalues())
# Combine all field generators to get the complete set of values
for each in itertools.product(*elems):
# each is a tuple with values for the sequence, join with fieldnames
pairs = itertools.izip(asn1_ty.Children.viewkeys(), each)
......@@ -495,6 +494,7 @@ class sdlHandler(QObject):
# for name, typedef in self.proc.dataview.viewitems():
# if name != 'MySeq': continue
# print 'All combinations of ', name
# for combi in compute_combinations(typedef, self.proc.dataview):
# print combi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment