chiark / gitweb /
Some minor fixes.
authordaid303 <daid303@gmail.com>
Fri, 7 Dec 2012 15:08:47 +0000 (16:08 +0100)
committerdaid303 <daid303@gmail.com>
Fri, 7 Dec 2012 15:08:47 +0000 (16:08 +0100)
Cura/cura_sf/fabmetheus_utilities/settings.py
Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py
Cura/gui/preview3d.py
Cura/util/profile.py

index 3264c79799b1adb4d59ba7265aaa822cb58688f0..43c9db488326b8f82d8dc6e4025f75a653a11d00 100644 (file)
@@ -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."
index 380aa31861f69406fcd6f9fcd09278684b1b2f7d..f42570fcc62343a889fbc200d82e6ffa140b7845 100644 (file)
@@ -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)
index 4f2b489dbed6152aa9d6b28082c8325625c0d129..c55f8483eced56044d3edf89f9612123f437fc2e 100644 (file)
@@ -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))
index fddfa846d5ef0fd8301fdc0d3f3b43cdf2771943..27314fd9384dac8900d82366f6f5c073351838ee 100644 (file)
@@ -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])