fix several Py3 issues

This commit is contained in:
wmayer
2019-01-03 18:11:37 +01:00
parent 730f314839
commit 3e12a59d41
12 changed files with 84 additions and 84 deletions

View File

@@ -18,11 +18,11 @@ def moveViews():
s = FreeCADGui.Selection.getSelection()
if len(s) != 2:
print "Please select 1 Drawing Page and 1 TechDraw Page"
print ("Please select 1 Drawing Page and 1 TechDraw Page")
return
print "First object in selection is a: ", s[0].TypeId
print "Second object in selection is a: ", s[1].TypeId
print ("First object in selection is a: ", s[0].TypeId)
print ("Second object in selection is a: ", s[1].TypeId)
if s[0].isDerivedFrom("Drawing::FeaturePage") and \
s[1].isDerivedFrom("TechDraw::DrawPage"):
dPage = s[0]
@@ -32,20 +32,20 @@ def moveViews():
tPage = s[0]
dPage = s[1]
else:
print "Please select 1 Drawing Page and 1 TechDraw Page"
print ("Please select 1 Drawing Page and 1 TechDraw Page")
return
i = 1
for o in dPage.OutList:
newName = "DraftView" + str(i).zfill(3)
print "moving " + o.Name + " to " + newName
print ("moving " + o.Name + " to " + newName)
svg = svgHead + o.ViewResult + svgTail
no = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewSymbol',newName)
no.Symbol = svg
tPage.addView(no)
i += 1
print "moveViews moved " + str(i-1) + " views"
print ("moveViews moved " + str(i-1) + " views")
if __name__ == '__main__':
moveViews()