python: PartDesign: *.py: Fix python3 syntax
This commit is contained in:
parent
8b45976c8d
commit
da1081bc98
|
@ -41,17 +41,18 @@ class PartDesignWorkbench ( Workbench ):
|
|||
try:
|
||||
from WizardShaft import WizardShaft
|
||||
except ImportError:
|
||||
print "Wizard shaft module cannot be loaded"
|
||||
print("Wizard shaft module cannot be loaded")
|
||||
try:
|
||||
from FeatureHole import HoleGui
|
||||
except:
|
||||
pass
|
||||
|
||||
import PartDesignGui
|
||||
import PartDesign
|
||||
try:
|
||||
import InvoluteGearFeature
|
||||
except ImportError:
|
||||
print "Involute gear module cannot be loaded"
|
||||
print("Involute gear module cannot be loaded")
|
||||
#try:
|
||||
# from FeatureHole import HoleGui
|
||||
#except:
|
||||
|
|
|
@ -85,9 +85,9 @@ def makeFilletArc(M1,P,Q,N,r2,ccw):
|
|||
t = t2
|
||||
|
||||
br2 = b.mult(r2)
|
||||
print br2
|
||||
print(br2)
|
||||
ut = u.mult(t)
|
||||
print ut
|
||||
print(ut)
|
||||
M2 = P.add(ut).add(br2)
|
||||
S1 = M1.mult(r2/(r1+r2)).add(M2.mult(r1/(r1+r2)))
|
||||
S2 = M2.sub(br2)
|
||||
|
|
|
@ -47,7 +47,7 @@ def makeRadialCopy():
|
|||
sel = sel[0]
|
||||
shape = sel.Shape
|
||||
name = sel.Label
|
||||
except IndexError, AttributeError:
|
||||
except (IndexError, AttributeError):
|
||||
QtGui.QMessageBox.critical(None,"Wrong selection","Please select a shape object")
|
||||
#raise Exception("Nothing selected")
|
||||
else:
|
||||
|
|
|
@ -350,7 +350,7 @@ class TranslationFunction:
|
|||
|
||||
try:
|
||||
self.boundaries = np.linalg.solve(A, b) # A * self.boundaries = b
|
||||
except np.linalg.linalg.LinAlgError, e:
|
||||
except np.linalg.linalg.LinAlgError as e:
|
||||
FreeCAD.Console.PrintMessage(e.message)
|
||||
FreeCAD.Console.PrintMessage(". No solution possible.\n")
|
||||
return
|
||||
|
|
|
@ -478,7 +478,7 @@ class Shaft:
|
|||
b = np.array([coefficientsF[ax][0], coefficientsM[ax][0]])
|
||||
try:
|
||||
solution = np.linalg.solve(A, b) # A * solution = b
|
||||
except np.linalg.linalg.LinAlgError, e:
|
||||
except np.linalg.linalg.LinAlgError as e:
|
||||
FreeCAD.Console.PrintMessage(e.message)
|
||||
FreeCAD.Console.PrintMessage(". No solution possible.\n")
|
||||
self.parent.updateButtons(ax, False)
|
||||
|
|
|
@ -67,5 +67,5 @@ if __name__ == '__main__':
|
|||
if len(args) != 2:
|
||||
p.error()
|
||||
m, Z = [float(v) for v in args]
|
||||
print makeGear(m, int(Z), float(opts.angle))
|
||||
print(makeGear(m, int(Z), float(opts.angle)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user