Salome HOME
890b3ae152b1c3e4ffaff284da036d7031a7b4ce
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin.py
1 """
2 """
3
4 import ModelAPI
5 from PythonFeaturesPlugin_Box import PythonFeaturesPlugin_Box
6
7
8 class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
9
10     def __init__(self):
11         ModelAPI.ModelAPI_Plugin.__init__(self)
12         aSession = ModelAPI.ModelAPI_Session.get()
13         aSession.registerPlugin(self)
14         pass
15
16     def createFeature(self, theFeatureID):
17         aFeature = None
18         if theFeatureID == PythonFeaturesPlugin_Box.ID():
19             aCompositeFeature = PythonFeaturesPlugin_Box().__disown__()
20             aFeature = ModelAPI.compositeFeatureToFeature(aCompositeFeature)
21         else:
22             raise StandardError("No such feature %s" % theFeatureID)
23         return aFeature
24
25
26 plugin = PythonFeaturesPlugin()
27 plugin.__disown__()