Arch: use string operator instead of numeric LGTM fix

This commit is contained in:
luz.paz
2019-10-22 10:29:54 -04:00
committed by Yorik van Havre
parent 4d1b9f8429
commit f53ef01d94
9 changed files with 11 additions and 11 deletions

View File

@@ -756,7 +756,7 @@ class _AxisTaskPanel:
l = []
for i in range(self.tree.topLevelItemCount()):
it = self.tree.findItems(str(i+1),QtCore.Qt.MatchExactly,0)[0]
if (remove == None) or (remove != i):
if (remove is None) or (remove != i):
if it.text(1):
d.append(float(it.text(1)))
else:

View File

@@ -1665,7 +1665,7 @@ class _ToggleSubs:
if hasattr(obj, "Subtractions"):
for sub in obj.Subtractions:
if not (Draft.getType(sub) in ["Window","Roof"]):
if mode == None:
if mode is None:
# take the first sub as base
mode = sub.ViewObject.isVisible()
if mode == True:

View File

@@ -196,7 +196,7 @@ class CommandPanel:
"this function is called by the snapper when it has a 3D point"
self.tracker.finalize()
if point == None:
if point is None:
return
FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Panel"))
FreeCADGui.addModule("Arch")

View File

@@ -186,7 +186,7 @@ def makeRailing(stairs):
railList.append(lrRail)
stair.Additions = railList
if stairs == None:
if stairs is None:
sel = FreeCADGui.Selection.getSelection()
sel0 = sel[0]
stairs = []

View File

@@ -271,10 +271,10 @@ class _CommandStructure:
"this function is called by the snapper when it has a 3D point"
self.bmode = self.modeb.isChecked()
if point == None:
if point is None:
self.tracker.finalize()
return
if self.bmode and (self.bpoint == None):
if self.bmode and (self.bpoint is None):
self.bpoint = point
FreeCADGui.Snapper.getPoint(last=point,callback=self.getPoint,movecallback=self.update,extradlg=[self.taskbox(),self.precast.form,self.dents.form],title=translate("Arch","Next point")+":",mode="line")
return

View File

@@ -461,7 +461,7 @@ class Renderer:
if r == 1:
l = faces.index(f2)
elif r == 2:
if h == None:
if h is None:
h = faces.index(f2)
else:
if faces.index(f2) < h:
@@ -497,7 +497,7 @@ class Renderer:
if sfaces and (notfoundstack < len(faces)):
if DEBUG: print("using ordered stack, notfound = ",notfoundstack)
p = self.findPosition(f1,sfaces)
if p == None:
if p is None:
# no position found, we move the face to the end of the pile
faces.remove(f1)
faces.append(f1)

View File

@@ -249,7 +249,7 @@ class _CommandWall:
if Draft.getType(obj) == "Wall":
if not obj in self.existing:
self.existing.append(obj)
if point == None:
if point is None:
self.tracker.finalize()
return
self.points.append(point)

View File

@@ -670,7 +670,7 @@ class _CommandWindow:
"this function is called by the snapper when it has a 3D point"
self.tracker.finalize()
if point == None:
if point is None:
return
# if something was selected, override the underlying object
if self.sel:

View File

@@ -433,7 +433,7 @@ def viewer(scene=None,background=(1.0,1.0,1.0),lightdir=None):
# Initialize Coin. This returns a main window to use
from pivy import sogui
win = sogui.SoGui.init()
if win == None:
if win is None:
print("Unable to create a SoGui window")
return