diff --git a/.gitignore b/.gitignore index a672712..6a0a701 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1 @@ -/printrun-0.0-5897fbc.tar.gz -/printrun-0.0-71e5da0.tar.gz -/printrun-0.0-80e313d.tar.gz -/printrun-0.0-b8f549b.tar.gz -/printrun-20131019.tar.gz -/printrun-20140126.tar.gz -/printrun-20140730.tar.gz -/printrun-20140801.tar.gz -/printrun-20150310.tar.gz +/printrun-*.tar.gz diff --git a/printrun-gtk3.patch b/printrun-gtk3.patch deleted file mode 100644 index 6c809c7..0000000 --- a/printrun-gtk3.patch +++ /dev/null @@ -1,291 +0,0 @@ -diff -up printrun/gui/controls.py.gtk3 printrun/gui/controls.py ---- printrun/gui/controls.py.gtk3 2015-03-09 07:22:14.000000000 -0400 -+++ printrun/gui/controls.py 2015-08-11 23:43:27.444624125 -0400 -@@ -136,7 +136,7 @@ def add_extra_controls(self, root, paren - if root.settings.last_temperature not in map(float, root.temps.values()): - htemp_choices = [str(root.settings.last_temperature)] + htemp_choices - root.htemp = wx.ComboBox(parentpanel, -1, choices = htemp_choices, -- style = wx.CB_DROPDOWN, size = (80, -1)) -+ style = wx.CB_DROPDOWN, size = (115, -1)) - root.htemp.SetToolTip(wx.ToolTip(_("Select Temperature for Hotend"))) - root.htemp.Bind(wx.EVT_COMBOBOX, root.htemp_change) - -@@ -156,7 +156,7 @@ def add_extra_controls(self, root, paren - if root.settings.last_bed_temperature not in map(float, root.bedtemps.values()): - btemp_choices = [str(root.settings.last_bed_temperature)] + btemp_choices - root.btemp = wx.ComboBox(parentpanel, -1, choices = btemp_choices, -- style = wx.CB_DROPDOWN, size = (80, -1)) -+ style = wx.CB_DROPDOWN, size = (115, -1)) - root.btemp.SetToolTip(wx.ToolTip(_("Select Temperature for Heated Bed"))) - root.btemp.Bind(wx.EVT_COMBOBOX, root.btemp_change) - add("btemp_val", root.btemp) -@@ -192,7 +192,11 @@ def add_extra_controls(self, root, paren - root.speed_slider = wx.Slider(speedpanel, -1, 100, 1, 300) - speedsizer.Add(root.speed_slider, 1, flag = wx.EXPAND) - -- root.speed_spin = FloatSpin(speedpanel, -1, value = 100, min_val = 1, max_val = 300, digits = 0, style = wx.ALIGN_LEFT, size = (80, -1)) -+ if wx.VERSION < (3, 0): -+ root.speed_spin = FloatSpin(speedpanel, -1, value = 100, min_val = 1, max_val = 300, digits = 0, style = wx.ALIGN_LEFT, size = (80, -1)) -+ else: -+ root.speed_spin = wx.SpinCtrlDouble(speedpanel, -1, initial = 100, min = 1, max = 300, style = wx.ALIGN_LEFT, size = (115, -1)) -+ root.speed_spin.SetDigits(0) - speedsizer.Add(root.speed_spin, 0, flag = wx.ALIGN_CENTER_VERTICAL) - root.speed_label = wx.StaticText(speedpanel, -1, _("%")) - speedsizer.Add(root.speed_label, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) -@@ -210,7 +214,10 @@ def add_extra_controls(self, root, paren - value = root.speed_spin.GetValue() - root.speed_setbtn.SetBackgroundColour("red") - root.speed_slider.SetValue(value) -- root.speed_spin.Bind(wx.EVT_SPINCTRL, speedslider_spin) -+ if wx.VERSION < (3, 0): -+ root.speed_spin.Bind(wx.EVT_SPINCTRL, speedslider_spin) -+ else: -+ root.speed_spin.Bind(wx.EVT_SPINCTRLDOUBLE, speedslider_spin) - - def speedslider_scroll(event): - value = root.speed_slider.GetValue() -@@ -269,10 +276,15 @@ def add_extra_controls(self, root, paren - esettingspanel = root.newPanel(parentpanel) - esettingssizer = wx.GridBagSizer() - esettingssizer.SetEmptyCellSize((0, 0)) -- root.edist = FloatSpin(esettingspanel, -1, value = root.settings.last_extrusion, min_val = 0, max_val = 1000, size = (90, -1), digits = 1) -+ if wx.VERSION < (3, 0): -+ root.edist = FloatSpin(esettingspanel, -1, value = root.settings.last_extrusion, min_val = 0, max_val = 1000, size = (90, -1), digits = 1) -+ root.edist.Bind(wx.EVT_SPINCTRL, root.setfeeds) -+ else: -+ root.edist = wx.SpinCtrlDouble(esettingspanel, -1, initial = root.settings.last_extrusion, min = 0, max = 1000, size = (135, -1)) -+ root.edist.SetDigits(1) -+ root.edist.Bind(wx.EVT_SPINCTRLDOUBLE, root.setfeeds) - root.edist.SetBackgroundColour((225, 200, 200)) - root.edist.SetForegroundColour("black") -- root.edist.Bind(wx.EVT_SPINCTRL, root.setfeeds) - root.edist.Bind(wx.EVT_TEXT, root.setfeeds) - add("edist_label", wx.StaticText(esettingspanel, -1, _("Length:")), container = esettingssizer, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT | wx.RIGHT | wx.LEFT, border = 5) - add("edist_val", root.edist, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) -@@ -280,11 +292,16 @@ def add_extra_controls(self, root, paren - add("edist_unit", wx.StaticText(esettingspanel, -1, unit_label), container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) - root.edist.SetToolTip(wx.ToolTip(_("Amount to Extrude or Retract (mm)"))) - if not mini_mode: -- root.efeedc = FloatSpin(esettingspanel, -1, value = root.settings.e_feedrate, min_val = 0, max_val = 50000, size = (90, -1), digits = 1) -+ if wx.VERSION < (3, 0): -+ root.efeedc = FloatSpin(esettingspanel, -1, value = root.settings.e_feedrate, min_val = 0, max_val = 50000, size = (90, -1), digits = 1) -+ root.efeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) -+ else: -+ root.efeedc = wx.SpinCtrlDouble(esettingspanel, -1, initial = root.settings.e_feedrate, min = 0, max = 50000, size = (145, -1)) -+ root.efeedc.SetDigits(1) -+ root.efeedc.Bind(wx.EVT_SPINCTRLDOUBLE, root.setfeeds) - root.efeedc.SetToolTip(wx.ToolTip(_("Extrude / Retract speed (mm/min)"))) - root.efeedc.SetBackgroundColour((225, 200, 200)) - root.efeedc.SetForegroundColour("black") -- root.efeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) - root.efeedc.Bind(wx.EVT_TEXT, root.setfeeds) - add("efeed_val", root.efeedc, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) - add("efeed_label", wx.StaticText(esettingspanel, -1, _("Speed:")), container = esettingssizer, flag = wx.ALIGN_LEFT) -@@ -379,12 +396,12 @@ class ControlsSizer(wx.GridBagSizer): - else: - self.extra_buttons[key] = btn - -- root.xyfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.xy_feedrate), min = 0, max = 50000, size = (97, -1)) -+ root.xyfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.xy_feedrate), min = 0, max = 50000, size = (130, -1)) - root.xyfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for X & Y axes (mm/min)"))) - llts.Add(wx.StaticText(lltspanel, -1, _("XY:")), flag = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) - llts.Add(root.xyfeedc) - llts.Add(wx.StaticText(lltspanel, -1, _("mm/min Z:")), flag = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) -- root.zfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.z_feedrate), min = 0, max = 50000, size = (90, -1)) -+ root.zfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.z_feedrate), min = 0, max = 50000, size = (130, -1)) - root.zfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for Z axis (mm/min)"))) - llts.Add(root.zfeedc,) - -diff -up printrun/gui/toolbar.py.gtk3 printrun/gui/toolbar.py ---- printrun/gui/toolbar.py.gtk3 2015-03-09 07:22:14.000000000 -0400 -+++ printrun/gui/toolbar.py 2015-06-29 23:43:30.700768952 -0400 -@@ -42,7 +42,7 @@ def MainToolbar(root, parentpanel = None - root.baud = wx.ComboBox(parentpanel, -1, - choices = ["2400", "9600", "19200", "38400", - "57600", "115200", "250000"], -- style = wx.CB_DROPDOWN, size = (100, -1)) -+ style = wx.CB_DROPDOWN, size = (110, -1)) - root.baud.SetToolTip(wx.ToolTip(_("Select Baud rate for printer communication"))) - try: - root.baud.SetValue("115200") -diff -up printrun/projectlayer.py.gtk3 printrun/projectlayer.py ---- printrun/projectlayer.py.gtk3 2015-03-09 07:22:14.000000000 -0400 -+++ printrun/projectlayer.py 2015-08-11 23:24:05.729359412 -0400 -@@ -278,38 +278,48 @@ class SettingsFrame(wx.Frame): - # Left Column - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Layer (mm):"), pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.thickness = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_layer", "0.1")), size = (80, -1)) -+ self.thickness = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_layer", "0.1")), size = (125, -1)) - self.thickness.Bind(wx.EVT_TEXT, self.update_thickness) - self.thickness.SetHelpText("The thickness of each slice. Should match the value used to slice the model. SVG files update this value automatically, 3dlp.zip files have to be manually entered.") - fieldsizer.Add(self.thickness, pos = (0, 1)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Exposure (s):"), pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.interval = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_interval", "0.5")), size = (80, -1)) -+ self.interval = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_interval", "0.5")), size = (125, -1)) - self.interval.Bind(wx.EVT_TEXT, self.update_interval) - self.interval.SetHelpText("How long each slice should be displayed.") - fieldsizer.Add(self.interval, pos = (1, 1)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Blank (s):"), pos = (2, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.pause = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_pause", "0.5")), size = (80, -1)) -+ self.pause = wx.TextCtrl(self.panel, -1, str(self._get_setting("project_pause", "0.5")), size = (125, -1)) - self.pause.Bind(wx.EVT_TEXT, self.update_pause) - self.pause.SetHelpText("The pause length between slices. This should take into account any movement of the Z axis, plus time to prepare the resin surface (sliding, tilting, sweeping, etc).") - fieldsizer.Add(self.pause, pos = (2, 1)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Scale:"), pos = (3, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.scale = floatspin.FloatSpin(self.panel, -1, value = self._get_setting('project_scale', 1.0), increment = 0.1, digits = 3, size = (80, -1)) -- self.scale.Bind(floatspin.EVT_FLOATSPIN, self.update_scale) -+ if wx.VERSION < (3, 0): -+ self.scale = floatspin.FloatSpin(self.panel, -1, value = self._get_setting('project_scale', 1.0), increment = 0.1, digits = 3, size = (80, -1)) -+ self.scale.Bind(floatspin.EVT_FLOATSPIN, self.update_scale) -+ else: -+ self.scale = wx.SpinCtrlDouble(self.panel, -1, initial = self._get_setting('project_scale', 1.0), inc = 0.1, size = (125, -1)) -+ self.scale.SetDigits(3) -+ self.scale.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_scale) - self.scale.SetHelpText("The additional scaling of each slice.") - fieldsizer.Add(self.scale, pos = (3, 1)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Direction:"), pos = (4, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.direction = wx.ComboBox(self.panel, -1, choices = ["Top Down", "Bottom Up"], value = self._get_setting('project_direction', "Top Down"), size = (80, -1)) -+ self.direction = wx.ComboBox(self.panel, -1, choices = ["Top Down", "Bottom Up"], value = self._get_setting('project_direction', "Top Down"), size = (125, -1)) - self.direction.Bind(wx.EVT_COMBOBOX, self.update_direction) - self.direction.SetHelpText("The direction the Z axis should move. Top Down is where the projector is above the model, Bottom up is where the projector is below the model.") - fieldsizer.Add(self.direction, pos = (4, 1), flag = wx.ALIGN_CENTER_VERTICAL) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Overshoot (mm):"), pos = (5, 0), flag = wx.ALIGN_CENTER_VERTICAL) -- self.overshoot = floatspin.FloatSpin(self.panel, -1, value = self._get_setting('project_overshoot', 3.0), increment = 0.1, digits = 1, min_val = 0, size = (80, -1)) -- self.overshoot.Bind(floatspin.EVT_FLOATSPIN, self.update_overshoot) -+ if wx.VERSION < (3, 0): -+ self.overshoot = floatspin.FloatSpin(self.panel, -1, value = self._get_setting('project_overshoot', 3.0), increment = 0.1, digits = 1, min_val = 0, size = (80, -1)) -+ self.overshoot.Bind(floatspin.EVT_FLOATSPIN, self.update_overshoot) -+ else: -+ self.overshoot = wx.SpinCtrlDouble(self.panel, -1, initial = self._get_setting('project_overshoot', 3.0), inc = 0.1, min = 0, size = (125, -1)) -+ self.overshoot.SetDigits(1) -+ self.overshoot.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_overshoot) - self.overshoot.SetHelpText("How far the axis should move beyond the next slice position for each slice. For Top Down printers this would dunk the model under the resi and then return. For Bottom Up printers this would raise the base away from the vat and then return.") - fieldsizer.Add(self.overshoot, pos = (5, 1)) - -@@ -329,38 +339,53 @@ class SettingsFrame(wx.Frame): - - fieldsizer.Add(wx.StaticText(self.panel, -1, "X (px):"), pos = (0, 2), flag = wx.ALIGN_CENTER_VERTICAL) - projectX = int(math.floor(float(self._get_setting("project_x", 1920)))) -- self.X = wx.SpinCtrl(self.panel, -1, str(projectX), max = 999999, size = (80, -1)) -+ self.X = wx.SpinCtrl(self.panel, -1, str(projectX), max = 999999, size = (125, -1)) - self.X.Bind(wx.EVT_SPINCTRL, self.update_resolution) - self.X.SetHelpText("The projector resolution in the X axis.") - fieldsizer.Add(self.X, pos = (0, 3)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Y (px):"), pos = (1, 2), flag = wx.ALIGN_CENTER_VERTICAL) - projectY = int(math.floor(float(self._get_setting("project_y", 1200)))) -- self.Y = wx.SpinCtrl(self.panel, -1, str(projectY), max = 999999, size = (80, -1)) -+ self.Y = wx.SpinCtrl(self.panel, -1, str(projectY), max = 999999, size = (125, -1)) - self.Y.Bind(wx.EVT_SPINCTRL, self.update_resolution) - self.Y.SetHelpText("The projector resolution in the Y axis.") - fieldsizer.Add(self.Y, pos = (1, 3)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "OffsetX (mm):"), pos = (2, 2), flag = wx.ALIGN_CENTER_VERTICAL) -- self.offset_X = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_offset_x", 0.0), increment = 1, digits = 1, size = (80, -1)) -- self.offset_X.Bind(floatspin.EVT_FLOATSPIN, self.update_offset) -+ if wx.VERSION < (3, 0): -+ self.offset_X = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_offset_x", 0.0), increment = 1, digits = 1, size = (80, -1)) -+ self.offset_X.Bind(floatspin.EVT_FLOATSPIN, self.update_offset) -+ else: -+ self.offset_X = wx.SpinCtrlDouble(self.panel, -1, initial = self._get_setting("project_offset_x", 0.0), inc = 1, size = (125, -1)) -+ self.offset_X.SetDigits(1) -+ self.offset_X.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_offset) - self.offset_X.SetHelpText("How far the slice should be offset from the edge in the X axis.") - fieldsizer.Add(self.offset_X, pos = (2, 3)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "OffsetY (mm):"), pos = (3, 2), flag = wx.ALIGN_CENTER_VERTICAL) -- self.offset_Y = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_offset_y", 0.0), increment = 1, digits = 1, size = (80, -1)) -- self.offset_Y.Bind(floatspin.EVT_FLOATSPIN, self.update_offset) -+ if wx.VERSION < (3, 0): -+ self.offset_Y = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_offset_y", 0.0), increment = 1, digits = 1, size = (80, -1)) -+ self.offset_Y.Bind(floatspin.EVT_FLOATSPIN, self.update_offset) -+ else: -+ self.offset_Y = wx.SpinCtrlDouble(self.panel, -1, initial = self._get_setting("project_offset_y", 0.0), inc = 1, size = (125, -1)) -+ self.offset_Y.SetDigits(1) -+ self.offset_Y.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_offset) - self.offset_Y.SetHelpText("How far the slice should be offset from the edge in the Y axis.") - fieldsizer.Add(self.offset_Y, pos = (3, 3)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "ProjectedX (mm):"), pos = (4, 2), flag = wx.ALIGN_CENTER_VERTICAL) -- self.projected_X_mm = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_projected_x", 505.0), increment = 1, digits = 1, size = (80, -1)) -- self.projected_X_mm.Bind(floatspin.EVT_FLOATSPIN, self.update_projected_Xmm) -+ if wx.VERSION < (3, 0): -+ self.projected_X_mm = floatspin.FloatSpin(self.panel, -1, value = self._get_setting("project_projected_x", 505.0), increment = 1, digits = 1, size = (80, -1)) -+ self.projected_X_mm.Bind(floatspin.EVT_FLOATSPIN, self.update_projected_Xmm) -+ else: -+ self.projected_X_mm = wx.SpinCtrlDouble(self.panel, -1, initial = self._get_setting("project_projected_x", 505.0), inc = 1, size = (125, -1)) -+ self.projected_X_mm.SetDigits(1) -+ self.projected_X_mm.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_projected_Xmm) - self.projected_X_mm.SetHelpText("The actual width of the entire projected image. Use the Calibrate grid to show the full size of the projected image, and measure the width at the same level where the slice will be projected onto the resin.") - fieldsizer.Add(self.projected_X_mm, pos = (4, 3)) - - fieldsizer.Add(wx.StaticText(self.panel, -1, "Z Axis Speed (mm/min):"), pos = (5, 2), flag = wx.ALIGN_CENTER_VERTICAL) -- self.z_axis_rate = wx.SpinCtrl(self.panel, -1, str(self._get_setting("project_z_axis_rate", 200)), max = 9999, size = (80, -1)) -+ self.z_axis_rate = wx.SpinCtrl(self.panel, -1, str(self._get_setting("project_z_axis_rate", 200)), max = 9999, size = (125, -1)) - self.z_axis_rate.Bind(wx.EVT_SPINCTRL, self.update_z_axis_rate) - self.z_axis_rate.SetHelpText("Speed of the Z axis in mm/minute. Take into account that slower rates may require a longer pause value.") - fieldsizer.Add(self.z_axis_rate, pos = (5, 3)) -@@ -394,7 +419,11 @@ class SettingsFrame(wx.Frame): - first_layer_boxer.Add(self.first_layer, flag = wx.ALIGN_CENTER_VERTICAL) - - first_layer_boxer.Add(wx.StaticText(self.panel, -1, " (s):"), flag = wx.ALIGN_CENTER_VERTICAL) -- self.show_first_layer_timer = floatspin.FloatSpin(self.panel, -1, value=-1, increment = 1, digits = 1, size = (55, -1)) -+ if wx.VERSION < (3, 0): -+ self.show_first_layer_timer = floatspin.FloatSpin(self.panel, -1, value=-1, increment = 1, digits = 1, size = (55, -1)) -+ else: -+ self.show_first_layer_timer = wx.SpinCtrlDouble(self.panel, -1, initial = -1, inc = 1, size = (125, -1)) -+ self.show_first_layer_timer.SetDigits(1) - self.show_first_layer_timer.SetHelpText("How long to display the first layer for. -1 = unlimited.") - first_layer_boxer.Add(self.show_first_layer_timer, flag = wx.ALIGN_CENTER_VERTICAL) - displaysizer.Add(first_layer_boxer, pos = (0, 6), flag = wx.ALIGN_CENTER_VERTICAL) -diff -up printrun/settings.py.gtk3 printrun/settings.py ---- printrun/settings.py.gtk3 2015-06-19 05:47:24.000000000 -0400 -+++ printrun/settings.py 2015-08-11 23:32:05.603437536 -0400 -@@ -145,7 +145,12 @@ class SpinSetting(wxSetting): - - def get_specific_widget(self, parent): - from wx.lib.agw.floatspin import FloatSpin -- self.widget = FloatSpin(parent, -1, min_val = self.min, max_val = self.max, digits = 0) -+ import wx -+ if wx.VERSION < (3, 0): -+ self.widget = FloatSpin(parent, -1, min_val = self.min, max_val = self.max, digits = 0) -+ else: -+ self.widget = wx.SpinCtrlDouble(parent, -1, min = self.min, max = self.max) -+ self.widget.SetDigits(0) - self.widget.SetValue(self.value) - orig = self.widget.GetValue - self.widget.GetValue = lambda: int(orig()) -@@ -155,7 +160,12 @@ class FloatSpinSetting(SpinSetting): - - def get_specific_widget(self, parent): - from wx.lib.agw.floatspin import FloatSpin -- self.widget = FloatSpin(parent, -1, value = self.value, min_val = self.min, max_val = self.max, increment = self.increment, digits = 2) -+ import wx -+ if wx.VERSION < (3, 0): -+ self.widget = FloatSpin(parent, -1, value = self.value, min_val = self.min, max_val = self.max, increment = self.increment, digits = 2) -+ else: -+ self.widget = wx.SpinCtrlDouble(parent, -1, initial = self.value, min = self.min, max = self.max, inc = self.increment) -+ self.widget.SetDigits(2) - return self.widget - - class BooleanSetting(wxSetting): -@@ -216,7 +226,12 @@ class BuildDimensionsSetting(wxSetting): - import wx - build_dimensions = parse_build_dimensions(self.value) - self.widgets = [] -- w = lambda val, m, M: self.widgets.append(FloatSpin(parent, -1, value = val, min_val = m, max_val = M, digits = 2)) -+ def w(val, m, M): -+ if wx.VERSION < (3, 0): -+ self.widgets.append(FloatSpin(parent, -1, value = val, min_val = m, max_val = M, digits = 2)) -+ else: -+ self.widgets.append(wx.SpinCtrlDouble(parent, -1, initial = val, min = m, max = M)) -+ self.widgets[-1].SetDigits(2) - addlabel = lambda name, pos: self.widget.Add(wx.StaticText(parent, -1, name), pos = pos, flag = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border = 5) - addwidget = lambda *pos: self.widget.Add(self.widgets[-1], pos = pos, flag = wx.RIGHT, border = 5) - self.widget = wx.GridBagSizer() diff --git a/printrun-segfault.patch b/printrun-segfault.patch new file mode 100644 index 0000000..b24c129 --- /dev/null +++ b/printrun-segfault.patch @@ -0,0 +1,39 @@ +From 610f9ffbe7e3fe017b1595fc227000734b96a7e7 Mon Sep 17 00:00:00 2001 +From: Kliment Yanev +Date: Mon, 19 Mar 2018 20:48:16 +0100 +Subject: [PATCH] Fix segfault on exit and traceback when toggling large graph + multiple times + +--- + printrun/gui/graph.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/printrun/gui/graph.py b/printrun/gui/graph.py +index f9ff83b9..80f98c54 100644 +--- a/printrun/gui/graph.py ++++ b/printrun/gui/graph.py +@@ -34,13 +34,14 @@ def __init__(self, root, parent_graph = None, size = (600, 600)): + + def Destroy(self): + self.graph.StopPlotting() ++ if self.parentg is not None: ++ self.parentg.window=None + return super(GraphWindow,self).Destroy() + + def __del__(self): + if self.parentg is not None: + self.parentg.window=None + self.graph.StopPlotting() +- super(GraphWindow,self).__del__(self) + + class Graph(BufferedCanvas): + '''A class to show a Graph with Pronterface.''' +@@ -87,7 +88,7 @@ def __init__(self, parent, id, root, pos = wx.DefaultPosition, + self.window = None + + def show_graph_window(self, event = None): +- if not self.window: ++ if self.window is None or not self.window: + self.window = GraphWindow(self.root, self) + self.window.Show() + if self.timer.IsRunning(): diff --git a/printrun-x11.patch b/printrun-x11.patch deleted file mode 100644 index dd9597a..0000000 --- a/printrun-x11.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/plater.py b/plater.py -index 469eeb2..bfcc975 100755 ---- a/plater.py -+++ b/plater.py -@@ -15,12 +15,14 @@ - # You should have received a copy of the GNU General Public License - # along with Printrun. If not, see . - -+import os - import sys - import wx - - from printrun.stlplater import StlPlater - - if __name__ == '__main__': -+ os.environ['GDK_BACKEND'] = 'x11' - app = wx.App(False) - main = StlPlater(filenames = sys.argv[1:]) - main.Show() -diff --git a/pronterface.py b/pronterface.py -index dbe295a..4152288 100755 ---- a/pronterface.py -+++ b/pronterface.py -@@ -15,6 +15,7 @@ - # You should have received a copy of the GNU General Public License - # along with Printrun. If not, see . - -+import os - import sys - - try: -@@ -32,6 +33,7 @@ not yet available for python3. You should try running with python2 instead.""") - from printrun.pronterface import PronterApp - - if __name__ == '__main__': -+ os.environ['GDK_BACKEND'] = 'x11' - app = PronterApp(False) - try: - app.MainLoop() diff --git a/printrun.spec b/printrun.spec index 6b71da7..dcd1c73 100644 --- a/printrun.spec +++ b/printrun.spec @@ -1,32 +1,35 @@ Name: printrun -%global year 2015 -%global month 03 -%global day 10 -Version: %{year}.%{month}.%{day} -%global tag %{name}-%{year}%{month}%{day} -Release: 11%{?dist} +Epoch: 1 +Version: 2.0.0 +%global prerel rc3 +%global uver %{version}%{?prerel} +%global tag %{name}-%{uver} +Release: 0.3.%{prerel}%{?dist} + Summary: RepRap printer interface and tools -# AppData is CC0 -License: GPLv3+ and CC0 -Group: Applications/Engineering +# Only AppData is FSFAP +License: GPLv3+ and FSFAP + URL: https://github.com/kliment/Printrun Source0: https://github.com/kliment/Printrun/archive/%{tag}.tar.gz -# https://bugzilla.redhat.com/show_bug.cgi?id=1231518 -Patch0: %{name}-gtk3.patch - -# https://github.com/kliment/Printrun/pull/790 -Patch1: %{name}-x11.patch +# https://github.com/kliment/Printrun/issues/909 +Patch0: %{name}-segfault.patch BuildRequires: gcc -BuildRequires: Cython -BuildRequires: python2-devel -BuildRequires: desktop-file-utils -BuildRequires: gettext -BuildRequires: python2-pyserial -Requires: pronterface = %{version}-%{release} -Requires: pronsole = %{version}-%{release} -Requires: plater = %{version}-%{release} +BuildRequires: python3-Cython +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pyserial +BuildRequires: %{_bindir}/appstream-util +BuildRequires: %{_bindir}/desktop-file-validate +BuildRequires: %{_bindir}/grep +BuildRequires: %{_bindir}/msgfmt +BuildRequires: %{_bindir}/sed + +Requires: pronterface = %{epoch}:%{version}-%{release} +Requires: pronsole = %{epoch}:%{version}-%{release} +Requires: plater = %{epoch}:%{version}-%{release} %description Printrun is a set of G-code sending applications for RepRap. @@ -39,6 +42,9 @@ This package installs whole Printrun. %package common Summary: Common files for Printrun +Requires: python3-appdirs +Requires: python3-lxml +Requires: python3-numpy %description common Printrun is a set of G-code sending applications for RepRap. @@ -48,8 +54,8 @@ This package contains common files. %package -n pronsole Summary: CLI interface for RepRap -Requires: python2-pyserial -Requires: %{name}-common = %{version}-%{release} +Requires: python3-pyserial +Requires: %{name}-common = %{epoch}:%{version}-%{release} # So that it just works Requires: 3dprinter-udev-rules @@ -63,13 +69,15 @@ It controls the ReRap printer. It is a part of Printrun. %package -n pronterface Summary: GUI interface for RepRap -Requires: python2-wxpython -Requires: python2-numpy -Requires: python2-cairosvg -Requires: python2-psutil -Requires: python2-pyglet +Requires: python3-cairocffi +Requires: python3-cffi +Requires: python3-dbus +Requires: python3-gobject +Requires: python3-psutil +Requires: python3-pyglet +Requires: python3-wxpython4 Requires: simarrange -Requires: pronsole = %{version}-%{release} +Requires: pronsole = %{epoch}:%{version}-%{release} # So that it just works Requires: 3dprinter-udev-rules @@ -83,11 +91,13 @@ It controls the ReRap printer. It is a part of Printrun. %package -n plater Summary: RepRap STL plater -Requires: python2-wxpython -Requires: %{name}-common = %{version}-%{release} -Requires: python2-numpy -Requires: python2-psutil -Requires: python2-pyglet +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Requires: python3-cairocffi +Requires: python3-cffi +Requires: python3-gobject +Requires: python3-psutil +Requires: python3-pyglet +Requires: python3-wxpython4 Requires: simarrange BuildArch: noarch @@ -99,9 +109,7 @@ It is a part of Printrun. %prep -%setup -qn Printrun-%{tag} -%patch0 -p0 -%patch1 -p1 +%autosetup -p1 -n Printrun-%{tag} # remove bundled skeinforge link sed -i 's|python skeinforge/skeinforge_application/skeinforge.py|set-your-slicer-in-settings|' %{name}/settings.py @@ -110,8 +118,11 @@ sed -i 's|python skeinforge/skeinforge_application/skeinforge_utilities/skeinfor # sed upstream's desktop files to remove .py extensions from Exec sed -i 's/.py//' *.desktop +# remove useless shebangs +grep -ilrx printrun -e '#!/usr/bin/env python3' --include '*.py'| xargs sed -i '1s|^#!/usr/bin/env python3$||' + %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +%py3_build # rebuild locales cd locale @@ -122,7 +133,7 @@ done cd .. %install -%{__python} setup.py install --skip-build --prefix %{buildroot}%{_prefix} +%py3_install cd %{buildroot}%{_bindir} for FILE in *.py; do @@ -131,11 +142,6 @@ done cd - -# desktop files -desktop-file-validate %{buildroot}%{_datadir}/applications/pronterface.desktop -desktop-file-validate %{buildroot}%{_datadir}/applications/pronsole.desktop -desktop-file-validate %{buildroot}%{_datadir}/applications/plater.desktop - # locales mkdir -p %{buildroot}%{_datadir}/locale cp -ar %{buildroot}%{_datadir}/pronterface/locale/* %{buildroot}%{_datadir}/locale @@ -145,24 +151,26 @@ ln -s -f %{_datadir}/locale/ %{buildroot}%{_datadir}/pronterface/ # the app expe %{find_lang} pronterface %{find_lang} plater + +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml + + %files %doc README* COPYING %files common -%{python_sitearch}/%{name} -%{python_sitearch}/Printrun-*.egg-info +%{python3_sitearch}/%{name} +%{python3_sitearch}/Printrun-*.egg-info %{_bindir}/printcore* -%{_datadir}/pixmaps/plater.png %doc README* COPYING %files -n pronsole %{_bindir}/pronsole* %{_datadir}/pixmaps/pronsole.png %{_datadir}/applications/pronsole.desktop -%if 0%{?fedora} < 21 -%dir %{_datadir}/appdata -%endif -%{_datadir}/appdata/pronsole.appdata.xml +%{_datadir}/metainfo/pronsole.appdata.xml %doc README* COPYING %files -n pronterface -f pronterface.lang @@ -170,22 +178,29 @@ ln -s -f %{_datadir}/locale/ %{buildroot}%{_datadir}/pronterface/ # the app expe %{_datadir}/pronterface %{_datadir}/pixmaps/pronterface.png %{_datadir}/applications/pronterface.desktop -%if 0%{?fedora} < 21 -%dir %{_datadir}/appdata -%endif -%{_datadir}/appdata/pronterface.appdata.xml +%{_datadir}/metainfo/pronterface.appdata.xml %doc README* COPYING %files -n plater -f plater.lang %{_bindir}/plater* %{_datadir}/applications/plater.desktop -%if 0%{?fedora} < 21 -%dir %{_datadir}/appdata -%endif -%{_datadir}/appdata/plater.appdata.xml +%{_datadir}/pixmaps/plater.png +%{_datadir}/metainfo/plater.appdata.xml %doc README* COPYING %changelog +* Mon Mar 19 2018 Miro Hrončok - 1:2.0.0-0.3.rc3 +- Update to 2.0.0rc3 + +* Mon Mar 19 2018 Miro Hrončok - 1:2.0.0-0.2.rc2 +- Update to 2.0.0rc2 + +* Sat Mar 03 2018 Miro Hrončok - 1:2.0.0-0.1.rc1 +- Update to 2.0.0rc1 +- Use Python 3 and wxPython 4 +- raise epoch +- AppData license changed from CC0 to FSFAP + * Fri Feb 09 2018 Fedora Release Engineering - 2015.03.10-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 3ad6748..7459408 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8bd4d3bba4ac84707003f7309c67403d printrun-20150310.tar.gz +SHA512 (printrun-2.0.0rc3.tar.gz) = f812e802956d22c876897184d05de300b86d0a0736ac61c08147ba590ea4596985bba37e221e87bafcb71797b6f63f07a5e63f806f14f39d5067ee12bd2bdba2