Salome HOME
90b23b9a9b171ded79eef7fc49ac7c3b3a5b7cdc
[modules/shaper.git] / src / PythonAddons / addons_Features.py
1 """Registration of all user-defined Python features
2 """
3
4 import ModelAPI
5 from macros.box.feature      import BoxFeature
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
19         if theFeatureID == BoxFeature.ID():
20             aFeature = BoxFeature().__disown__()
21
22         else:
23             raise StandardError("No such feature %s" % theFeatureID)
24
25         return aFeature
26
27
28 plugin = PythonFeaturesPlugin()
29 plugin.__disown__()