Coverity: [skip ci] Bad use of null-like value
This commit is contained in:
@@ -57,6 +57,7 @@ class HoleGui:
|
||||
return
|
||||
if selection[0].DocumentName != doc.Name:
|
||||
QtGui.QMessageBox.critical(mw, "Wrong document", "Please select a face in the active document")
|
||||
return
|
||||
# Note: For some reason setting the Support property here breaks all sorts of things.
|
||||
# It is done in TaskHole.updateUI() instead
|
||||
|
||||
@@ -64,6 +65,7 @@ class HoleGui:
|
||||
body = FreeCADGui.activeView().getActiveObject("pdbody");
|
||||
if body is None:
|
||||
QtGui.QMessageBox.critical(mw, "No active body", "Please create a body or make a body active")
|
||||
return
|
||||
|
||||
feature = doc.addObject("Part::FeaturePython","Hole")
|
||||
hole = Hole(feature)
|
||||
|
||||
@@ -29,9 +29,9 @@ def makeSprocket(P, N, Dr):
|
||||
w = FCWireBuilder()
|
||||
sprocket.CreateSprocket(w, P, N, Dr)
|
||||
sprocketw = Part.Wire([o.toShape() for o in w.wire])
|
||||
sprocket = doc.addObject("Part::Feature", "Sprocket")
|
||||
sprocket.Shape = sprocketw
|
||||
return sprocket
|
||||
sprocketf = doc.addObject("Part::Feature", "Sprocket")
|
||||
sprocketf.Shape = sprocketw
|
||||
return sprocketf
|
||||
|
||||
class FCWireBuilder(object):
|
||||
"""A helper class to prepare a Part.Wire object"""
|
||||
|
||||
@@ -173,6 +173,7 @@ class Tank:
|
||||
return Vector()
|
||||
if vol >= fp.Shape.Volume:
|
||||
vol = 0.0
|
||||
cog = Vector()
|
||||
for solid in fp.Shape.Solids:
|
||||
vol += solid.Volume
|
||||
sCoG = solid.CenterOfMass
|
||||
|
||||
@@ -320,11 +320,11 @@ def handle():
|
||||
f = QtCore.QFile(path)
|
||||
if f.open(QtCore.QIODevice.ReadOnly | QtCore.QFile.Text):
|
||||
ALTCSS = encode(QtCore.QTextStream(f).readAll())
|
||||
HTML = HTML.replace("<!--QSS-->","<style type=\"text/css\">"+ALTCSS+"</style>")
|
||||
else:
|
||||
with open(path, 'r') as f:
|
||||
ALTCSS = encode(f.read())
|
||||
|
||||
HTML = HTML.replace("<!--QSS-->","<style type=\"text/css\">"+ALTCSS+"</style>")
|
||||
HTML = HTML.replace("<!--QSS-->","<style type=\"text/css\">"+ALTCSS+"</style>")
|
||||
|
||||
# turn tips off if needed
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ def getlinks(html):
|
||||
rg = re.findall('href="\/wiki\/(.*?)"',l)
|
||||
if "images" in rg:
|
||||
rg = None
|
||||
if "mediawiki" in rg:
|
||||
elif "mediawiki" in rg:
|
||||
rg = None
|
||||
if rg:
|
||||
rg = rg[0]
|
||||
|
||||
Reference in New Issue
Block a user