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