From: azv Date: Wed, 23 Nov 2016 13:29:12 +0000 (+0300) Subject: Workaround for Debian 6.0 (issues #1868 and #1878) X-Git-Tag: V_2.6.0~64 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ab48627ddcce7642cd320525e87776421b95387;p=modules%2Fshaper.git Workaround for Debian 6.0 (issues #1868 and #1878) Loading of SketchPlugin should be before loading of SketchAPI module --- diff --git a/src/PythonAPI/model/sketcher/__init__.py b/src/PythonAPI/model/sketcher/__init__.py index 7aa993434..2edb1d226 100644 --- a/src/PythonAPI/model/sketcher/__init__.py +++ b/src/PythonAPI/model/sketcher/__init__.py @@ -1,5 +1,20 @@ """Package for Sketch plugin for the Parametric Geometry API of the Modeler. """ +# DEBIAN 6.0 WORKAROUND START +""" + Following code is used to support Debian 6.0. + It is kept, because SketchPlugin should be loaded before SketchAPI is first used. + Otherwise, the runtime error will be generated while some static inline methods are broken. +""" +from ModelAPI import * +aSession = ModelAPI_Session.get() +aDocument = aSession.moduleDocument() +aSession.startOperation() +aDocument.addFeature("Sketch") +aSession.finishOperation() +aSession.abortOperation() +# DEBIAN 6.0 WORKAROUND FINISH + from SketchAPI import addSketch from tools import addPolyline, addPolygon