Use exhaust() in some preview loaders to exhaust iterators.
This commit is contained in:
parent
d74ebcf932
commit
c5836353c6
@ -18,7 +18,7 @@ from mcedit2.util.worldloader import WorldLoader
|
||||
from mcedit2.widgets.layout import Column
|
||||
from mcedit2.widgets.spinslider import SpinSlider
|
||||
from mceditlib.schematic import createSchematic
|
||||
|
||||
from mceditlib.util import exhaust
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -402,8 +402,7 @@ class GenerateTool(EditorTool):
|
||||
|
||||
self.loader = WorldLoader(self.worldScene)
|
||||
if dim.chunkCount() <= self.instantDisplayChunks:
|
||||
for _ in self.loader.work():
|
||||
pass
|
||||
exhaust(self.loader.work())
|
||||
else:
|
||||
self.loader.timer.start()
|
||||
else:
|
||||
|
@ -17,6 +17,7 @@ from mcedit2.util.glutils import gl
|
||||
from mceditlib import faces
|
||||
from mceditlib.exceptions import ChunkNotPresent
|
||||
from mceditlib.selection import SectionBox, BoundingBox, SelectionBox, rayIntersectsBox
|
||||
from mceditlib.util import exhaust
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -152,8 +153,8 @@ class SelectionScene(scenegraph.Node):
|
||||
self.groupNode.clear()
|
||||
self._loader = None
|
||||
if selection.chunkCount < 16:
|
||||
for _ in self.loadSections():
|
||||
pass
|
||||
exhaust(self.loadSections())
|
||||
|
||||
self.loadTimer.setInterval(333)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user