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