From d2f7aa4199f1304a8772cec81e0b9e99368f66ec Mon Sep 17 00:00:00 2001 From: daid303 Date: Fri, 7 Dec 2012 16:08:47 +0100 Subject: [PATCH] Some minor fixes. --- Cura/cura_sf/fabmetheus_utilities/settings.py | 6 +++--- .../skeinforge_plugins/craft_plugins/dimension.py | 2 +- Cura/gui/preview3d.py | 3 ++- Cura/util/profile.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cura/cura_sf/fabmetheus_utilities/settings.py b/Cura/cura_sf/fabmetheus_utilities/settings.py index 3264c79..43c9db4 100644 --- a/Cura/cura_sf/fabmetheus_utilities/settings.py +++ b/Cura/cura_sf/fabmetheus_utilities/settings.py @@ -514,9 +514,9 @@ class FileNameInput(StringSetting ): return self class HelpPage: - "A class to open a help page." - def getOpenFromAbsolute( self, hypertextAddress ): - return self + "A class to open a help page." + def getOpenFromAbsolute( self, hypertextAddress ): + return self class MenuButtonDisplay: "A class to add a combo box selection." diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py index 380aa31..f42570f 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py @@ -242,7 +242,7 @@ class DimensionSkein: line = extra + line self.oldLocation = location else: - if self.oldLocation == None: + if self.oldLocation is None: print('Warning: There was no absolute location when the G91 command was parsed, so the absolute location will be set to the origin.') self.oldLocation = Vector3() location = gcodec.getLocationFromSplitLine(None, splitLine) diff --git a/Cura/gui/preview3d.py b/Cura/gui/preview3d.py index 4f2b489..c55f848 100644 --- a/Cura/gui/preview3d.py +++ b/Cura/gui/preview3d.py @@ -468,6 +468,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas): self.oldY = 0 self.dragType = '' self.tempRotate = 0 + self.viewport = None def updateProfileToControls(self): self.objColor[0] = profile.getPreferenceColour('model_colour') @@ -478,7 +479,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas): def OnMouseMotion(self,e): cursorXY = 100000 radius = 0 - if self.parent.objectsMaxV != None: + if self.parent.objectsMaxV is not None and self.viewport is not None: radius = self.parent.objectsBounderyCircleSize * profile.getProfileSettingFloat('model_scale') p0 = numpy.array(gluUnProject(e.GetX(), self.viewport[1] + self.viewport[3] - e.GetY(), 0, self.modelMatrix, self.projMatrix, self.viewport)) diff --git a/Cura/util/profile.py b/Cura/util/profile.py index fddfa84..27314fd 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -578,8 +578,8 @@ def getPluginList(): elif line[0].upper() == 'DEPEND': pass elif line[0].upper() == 'PARAM': - m = re.match('([a-zA-Z]*)\(([a-zA-Z_]*)(?:\:([^\)]*))?\) +(.*)', line[1].strip()) - if m != None: + m = re.match('([a-zA-Z]*)\(([a-zA-Z_]*)(?::([^\)]*))?\) +(.*)', line[1].strip()) + if m is not None: item['params'].append({'name': m.group(1), 'type': m.group(2), 'default': m.group(3), 'description': m.group(4)}) else: print "Unknown item in effect meta data: %s %s" % (line[0], line[1])