Salome HOME
ca671e1449df5c7d037c81d73b1bbe8d3e9d5b75
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin.py
1 import ModelAPI
2 from PythonFeaturesPlugin_Box import PythonFeaturesPlugin_Box
3
4
5 class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
6
7     def __init__(self):
8         ModelAPI.ModelAPI_Plugin.__init__(self)
9         pass
10
11     def createFeature(self, theFeatureID):
12         if theFeatureID == PythonFeaturesPlugin_Box.ID():
13             return PythonFeaturesPlugin_Box().__disown__()
14         else:
15             raise StandardError("No such feature %s" % theFeatureID)
16
17 plugin = PythonFeaturesPlugin()
18 aSession = ModelAPI.ModelAPI_Session.get()
19 print "Module loaded. Session", aSession
20 aSession.registerPlugin(plugin)