mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 19:27:10 +00:00
Separate out consume_iterator()
This commit is contained in:
@@ -210,8 +210,7 @@ def create_shape(settings, inst, repr=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def iterate(settings, file_or_filename, num_threads=1, include=None, exclude=None):
|
def consume_iterator(it):
|
||||||
it = iterator(settings, file_or_filename, num_threads, include, exclude)
|
|
||||||
if it.initialize():
|
if it.initialize():
|
||||||
while True:
|
while True:
|
||||||
yield it.get()
|
yield it.get()
|
||||||
@@ -219,6 +218,11 @@ def iterate(settings, file_or_filename, num_threads=1, include=None, exclude=Non
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def iterate(settings, file_or_filename, num_threads=1, include=None, exclude=None):
|
||||||
|
it = iterator(settings, file_or_filename, num_threads, include, exclude)
|
||||||
|
yield from consume_iterator(it)
|
||||||
|
|
||||||
|
|
||||||
def make_shape_function(fn):
|
def make_shape_function(fn):
|
||||||
def entity_instance_or_none(e):
|
def entity_instance_or_none(e):
|
||||||
return None if e is None else entity_instance(e)
|
return None if e is None else entity_instance(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user