Skip to content

Commit

Permalink
python: Draft: *.py: Fix syntax for Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
plaes authored and wwmayer committed Feb 4, 2017
1 parent 09ef1e9 commit 81464b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Draft/Draft.py
Expand Up @@ -4752,7 +4752,7 @@ def execute(self, obj):
try:
shape = Part.Wire(edges)
except Part.OCCError:
print "Error wiring edges"
print("Error wiring edges")
shape = None
if "ChamferSize" in obj.PropertiesList:
if obj.ChamferSize.Value != 0:
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Draft/DraftGeomUtils.py
Expand Up @@ -694,7 +694,7 @@ def sortEdges(edges):
edict.setdefault( e.Vertexes[-1].hashCode(),[] ).append(e)
nedges.append(e)
if not nedges:
print "DraftGeomUtils.sortEdges: zero-length edges"
print("DraftGeomUtils.sortEdges: zero-length edges")
return edges
# Find the start of the path. The start is the vertex that appears
# in the sdict dictionary but not in the edict dictionary, and has
Expand Down Expand Up @@ -856,7 +856,7 @@ def invert(edge):
elif geomType(edge) in ["BSplineCurve","BezierCurve"]:
if isLine(edge.Curve):
return Part.LineSegment(edge.Vertexes[-1].Point,edge.Vertexes[0].Point).toShape()
print "DraftGeomUtils.invert: unable to invert ",edge.Curve
print("DraftGeomUtils.invert: unable to invert ",edge.Curve)
return edge


Expand Down Expand Up @@ -1176,7 +1176,7 @@ def offsetWire(wire,dvec,bind=False,occ=False):
v = vec(curredge)
angle = DraftVecUtils.angle(vec(edges[0]),v,norm)
delta = DraftVecUtils.rotate(delta,angle,norm)
#print "edge ",i,": ",curredge.Curve," ",curredge.Orientation," parameters:",curredge.ParameterRange," vector:",delta
#print("edge ",i,": ",curredge.Curve," ",curredge.Orientation," parameters:",curredge.ParameterRange," vector:",delta)
nedge = offset(curredge,delta,trim=True)
if not nedge:
return None
Expand Down Expand Up @@ -1240,7 +1240,7 @@ def connect(edges,closed=False):
except:
print("DraftGeomUtils.connect: unable to connect edges")
for e in nedges:
print e.Curve, " ",e.Vertexes[0].Point, " ", e.Vertexes[-1].Point
print(e.Curve, " ",e.Vertexes[0].Point, " ", e.Vertexes[-1].Point)
return None

def findDistance(point,edge,strict=False):
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -2664,8 +2664,8 @@ def finish(self,closed=False):
def numericRadius(self,rad):
'''this function gets called by the toolbar when
valid radius have been entered there'''
#print "dvec:",self.dvec
#print "rad:",rad
#print("dvec:",self.dvec)
#print("rad:",rad)
if self.dvec:
if isinstance(self.dvec,float):
if self.mode == "Circle":
Expand All @@ -2677,7 +2677,7 @@ def numericRadius(self,rad):
rad = r1 - rad
d = str(rad)
else:
print "Draft.Offset error: Unhandled case"
print("Draft.Offset error: Unhandled case")
else:
self.dvec.normalize()
self.dvec.multiply(rad)
Expand Down

0 comments on commit 81464b5

Please sign in to comment.