python: TemplatePyMod: *.py: Fix python3 syntax
This commit is contained in:
parent
a101d426a4
commit
f6b6e62a57
|
@ -79,7 +79,7 @@ def makeSnapshotWithoutGui():
|
|||
|
||||
# Other formats are only available if simage package is installed
|
||||
if off.isWriteSupported("PNG"):
|
||||
print "Save as PNG"
|
||||
print("Save as PNG")
|
||||
off.writeToFile("crystal.png","PNG")
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
|
|
|
@ -28,7 +28,7 @@ def addCommand(name,cmdObject):
|
|||
class TemplatePyMod_Cmd1:
|
||||
"Example command class"
|
||||
def Activated(self):
|
||||
print "TemplatePyMod_Cmd1 activated ;-) "
|
||||
print("TemplatePyMod_Cmd1 activated ;-) ")
|
||||
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'Std_Tool1', 'MenuText': 'Example command', 'ToolTip': 'Very unimportand example command'}
|
||||
|
@ -235,9 +235,9 @@ class TemplatePyCheckable:
|
|||
"Example toggle command class"
|
||||
def Activated(self, index):
|
||||
if index == 0:
|
||||
print "Toggle is off"
|
||||
print("Toggle is off")
|
||||
else:
|
||||
print "Toggle is on"
|
||||
print("Toggle is on")
|
||||
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'python', 'MenuText': 'Toggle command', 'ToolTip': 'Example toggle command', 'Checkable': True}
|
||||
|
|
|
@ -654,7 +654,7 @@ class ViewProviderEnumTest:
|
|||
obj.Proxy = self
|
||||
|
||||
def updateData(self, fp, prop):
|
||||
print "prop updated:",prop
|
||||
print("prop updated:",prop)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
|
|
@ -20,7 +20,7 @@ def PlaceBox(x,y,z):
|
|||
return mbox
|
||||
|
||||
def Sierpinski(level,x0,y0,z0):
|
||||
#print threading.current_thread().name
|
||||
#print(threading.current_thread().name)
|
||||
boxnums = pow(3,level)
|
||||
thirds = boxnums / 3
|
||||
twothirds = thirds * 2
|
||||
|
@ -95,7 +95,7 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0):
|
|||
threads.append(thr)
|
||||
args=args[count:]
|
||||
|
||||
print "Number of threads: %i" % (len(threads))
|
||||
print("Number of threads: %i" % (len(threads)))
|
||||
for thr in threads:
|
||||
thr.start()
|
||||
for thr in threads:
|
||||
|
@ -106,11 +106,11 @@ def makeMengerSponge_mt(level=3,x0=0,y0=0,z0=0):
|
|||
mesh.addMesh(thr.mesh)
|
||||
del thr.mesh
|
||||
|
||||
print mesh
|
||||
print(mesh)
|
||||
mesh.removeDuplicatedPoints()
|
||||
mesh.removeFacets(mesh.getInternalFacets())
|
||||
mesh.rebuildNeighbourHood()
|
||||
print "Mesh is solid: %s" % (mesh.isSolid())
|
||||
print("Mesh is solid: %s" % (mesh.isSolid()))
|
||||
Mesh.show(mesh)
|
||||
|
||||
|
||||
|
@ -121,5 +121,5 @@ def makeMengerSponge(level=3,x0=0,y0=0,z0=0):
|
|||
mesh.removeDuplicatedPoints()
|
||||
mesh.removeFacets(mesh.getInternalFacets())
|
||||
mesh.rebuildNeighbourHood()
|
||||
print "Mesh is solid: %s" % (mesh.isSolid())
|
||||
print("Mesh is solid: %s" % (mesh.isSolid()))
|
||||
Mesh.show(mesh)
|
||||
|
|
|
@ -69,14 +69,14 @@ class ParameterTestCase(unittest.TestCase):
|
|||
# Parameter testing
|
||||
#FreeCAD.PrintLog("Base::ParameterTestCase::testNesting\n")
|
||||
for i in range(50):
|
||||
self.TestPar.SetFloat(`i`,4711.4711)
|
||||
self.TestPar.SetInt(`i`,4711)
|
||||
self.TestPar.SetBool(`i`,1)
|
||||
Temp = self.TestPar.GetGroup(`i`)
|
||||
self.TestPar.SetFloat(i,4711.4711)
|
||||
self.TestPar.SetInt(i,4711)
|
||||
self.TestPar.SetBool(i,1)
|
||||
Temp = self.TestPar.GetGroup(i)
|
||||
for l in range(50):
|
||||
Temp.SetFloat(`l`,4711.4711)
|
||||
Temp.SetInt(`l`,4711)
|
||||
Temp.SetBool(`l`,1)
|
||||
Temp.SetFloat(l,4711.4711)
|
||||
Temp.SetInt(l,4711)
|
||||
Temp.SetBool(l,1)
|
||||
Temp = 0
|
||||
|
||||
def testExportImport(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user