Commit b2f95128 authored by Guillaume Seguin's avatar Guillaume Seguin

Import gviz/gviz depending things just in time to lighten base memory usage

parent c635bd67
......@@ -18,8 +18,6 @@ import logging
import wx
from printrun import gviz
class NoViz(object):
showall = False
......@@ -78,6 +76,7 @@ class VizPane(wx.BoxSizer):
+ "Falling back to 2D view, and here is the backtrace:\n"
+ traceback.format_exc())
if use2dview:
from printrun import gviz
root.gviz = gviz.Gviz(parentpanel, (300, 300),
build_dimensions = root.build_dimensions_list,
grid = (root.settings.preview_grid_step1, root.settings.preview_grid_step2),
......@@ -100,6 +99,7 @@ class VizPane(wx.BoxSizer):
+ "Falling back to 2D view, and here is the backtrace:\n"
+ traceback.format_exc())
if not use3dview:
from printrun import gviz
root.gwindow = gviz.GvizWindow(build_dimensions = root.build_dimensions_list,
grid = (root.settings.preview_grid_step1, root.settings.preview_grid_step2),
extrusion_width = root.settings.preview_extrusion_width,
......
......@@ -57,7 +57,6 @@ class PronterfaceQuitException(Exception):
pass
from .gui import MainWindow
from .excluder import Excluder
from .settings import wxSetting, HiddenSetting, StringSetting, SpinSetting, \
FloatSpinSetting, BooleanSetting, StaticTextSetting
from printrun import gcoder
......@@ -775,6 +774,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx.CallAfter(self.statusbar.SetStatusText, _("No file loaded. Please use load first."))
return
if not self.excluder:
from .excluder import Excluder
self.excluder = Excluder()
self.excluder.pop_window(self.fgcode, bgcolor = self.bgcolor,
build_dimensions = self.build_dimensions_list)
......
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