Commit e7350527 authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

guidedSubdivisionIterator: add context parametr

parent 3ab84fec
......@@ -163,7 +163,7 @@ def subdivisionIterator(G, edges = None):
yield L
def guidedSubdivisionIterator(G, edges = None, guide = lambda H: (True, None)):
def guidedSubdivisionIterator(G, edges = None, guide = lambda H: (True, None), context = None):
class DeadEnd(Exception):
pass
......@@ -172,7 +172,10 @@ def guidedSubdivisionIterator(G, edges = None, guide = lambda H: (True, None)):
def impl(G, edges):
if len(edges) == 0:
if context is None:
cont, val = guide(G)
else:
cont, val = guide(G, context)
if not cont:
raise DeadEnd()
yield val
......
Supports Markdown
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