Skip to content

Commit

Permalink
Arch: use string operator instead of numeric LGTM fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luzpaz authored and yorikvanhavre committed Oct 25, 2019
1 parent 95af9ed commit 5c1cae1
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchAxis.py
Expand Up @@ -756,7 +756,7 @@ def resetObject(self,remove=None):
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:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchCommands.py
Expand Up @@ -1665,7 +1665,7 @@ def Activated(self):
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:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchPanel.py
Expand Up @@ -196,7 +196,7 @@ def getPoint(self,point=None,obj=None):
"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")
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchStairs.py
Expand Up @@ -186,7 +186,7 @@ def makeRailingLorR(stairs,side="L"):
railList.append(lrRail)
stair.Additions = railList

if stairs == None:
if stairs is None:
sel = FreeCADGui.Selection.getSelection()
sel0 = sel[0]
stairs = []
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchStructure.py
Expand Up @@ -271,10 +271,10 @@ def getPoint(self,point=None,obj=None):
"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
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchVRM.py
Expand Up @@ -461,7 +461,7 @@ def findPosition(self,f1,faces):
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:
Expand Down Expand Up @@ -497,7 +497,7 @@ def sort(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchWall.py
Expand Up @@ -249,7 +249,7 @@ def getPoint(self,point=None,obj=None):
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)
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ArchWindow.py
Expand Up @@ -670,7 +670,7 @@ def getPoint(self,point=None,obj=None):
"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:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/OfflineRenderingUtils.py
Expand Up @@ -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

Expand Down

0 comments on commit 5c1cae1

Please sign in to comment.