Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin.py
index e7a28080540a8284c36a9fbb433693512607cb86..ca671e1449df5c7d037c81d73b1bbe8d3e9d5b75 100644 (file)
@@ -1,17 +1,20 @@
-from ModelAPI import *
-import PythonFeaturesPlugin_Box
+import ModelAPI
+from PythonFeaturesPlugin_Box import PythonFeaturesPlugin_Box
 
-class PythonFeaturesPlugin(ModelAPI_Plugin):
-  def __init__(self):
-    ModelAPI_Plugin.__init__(self)
-    pass
 
-  def createFeature(self, theFeatureID):
-    if theFeatureID == PythonFeaturesPlugin_Box.ID():
-      return PythonFeaturesPlugin_Box()
-    else:
-      raise StandardError("No such feature %s"%theFeatureID)
+class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
 
-plugin = PythonFeaturesPlugin()
-ModelAPI_Session_get().registerPlugin(plugin)
+    def __init__(self):
+        ModelAPI.ModelAPI_Plugin.__init__(self)
+        pass
+
+    def createFeature(self, theFeatureID):
+        if theFeatureID == PythonFeaturesPlugin_Box.ID():
+            return PythonFeaturesPlugin_Box().__disown__()
+        else:
+            raise StandardError("No such feature %s" % theFeatureID)
 
+plugin = PythonFeaturesPlugin()
+aSession = ModelAPI.ModelAPI_Session.get()
+print "Module loaded. Session", aSession
+aSession.registerPlugin(plugin)