From 912eabf3f7d6e54a4bb735aaed7f43324a354354 Mon Sep 17 00:00:00 2001 From: Renaud NEDELEC Date: Mon, 19 Oct 2015 17:24:36 +0200 Subject: [PATCH] [PythonAPI / sketcher] small syntax modifications --- src/PythonAPI/modeler/sketcher/arc.py | 20 ++++++++++++-------- src/PythonAPI/modeler/sketcher/line.py | 8 ++++---- src/PythonAPI/{modeler => }/pylintrc | 0 3 files changed, 16 insertions(+), 12 deletions(-) rename src/PythonAPI/{modeler => }/pylintrc (100%) diff --git a/src/PythonAPI/modeler/sketcher/arc.py b/src/PythonAPI/modeler/sketcher/arc.py index 853ceb6c9..616170402 100644 --- a/src/PythonAPI/modeler/sketcher/arc.py +++ b/src/PythonAPI/modeler/sketcher/arc.py @@ -4,6 +4,7 @@ from GeomDataAPI import geomDataAPI_Point2D from modeler.errors import WrongNumberOfArguments class Arc(): + """Interface for editing a sketch arc feature.""" def __init__(self, arc_feature, *args): self._feature = arc_feature self._center = geomDataAPI_Point2D( @@ -24,16 +25,20 @@ class Arc(): "Arc takes 3 or 6 arguments (%s given)" % len(args) ) - def centerData (self): + def centerData(self): + """Return the center point data.""" return self._center - def startPointData (self): + def startPointData(self): + """Return the start point data.""" return self._start_point - def endPointData (self): + def endPointData(self): + """Return the end point data.""" return self._end_point - def result (self): + def result(self): + """Return the arc circular line attribute.""" return self._feature.lastResult() ######## @@ -42,10 +47,9 @@ class Arc(): # ######## - def __createByCoordinates(self, - center_x, center_y, - start_x, start_y, - end_x, end_y): + def __createByCoordinates(self, center_x, center_y, + start_x, start_y, + end_x, end_y): """Create an arc by point coordinates.""" self._center.setValue(center_x, center_y) self._start_point.setValue(start_x, start_y) diff --git a/src/PythonAPI/modeler/sketcher/line.py b/src/PythonAPI/modeler/sketcher/line.py index 99d794c9b..dfe8a1c93 100644 --- a/src/PythonAPI/modeler/sketcher/line.py +++ b/src/PythonAPI/modeler/sketcher/line.py @@ -33,13 +33,13 @@ class Line(): self._feature.data().selection("External").selectSubShape("EDGE", name) self._feature.execute() rigid = sketch.addFeature("SketchConstraintRigid") - rigid.refattr("ConstraintEntityA").setObject( self._feature.firstResult() ) + rigid.refattr("ConstraintEntityA").setObject(self._feature.firstResult()) - def startPointData (self): + def startPointData(self): return self._start_point - def endPointData (self): + def endPointData(self): return self._end_point - def result (self): + def result(self): return self._feature.firstResult() \ No newline at end of file diff --git a/src/PythonAPI/modeler/pylintrc b/src/PythonAPI/pylintrc similarity index 100% rename from src/PythonAPI/modeler/pylintrc rename to src/PythonAPI/pylintrc -- 2.39.2