1 """Registration of all user-defined Python features
5 from macros.box.feature import BoxFeature
6 from macros.cylinder.feature import CylinderFeature
9 class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
12 ModelAPI.ModelAPI_Plugin.__init__(self)
13 aSession = ModelAPI.ModelAPI_Session.get()
14 aSession.registerPlugin(self)
17 def createFeature(self, theFeatureID):
20 if theFeatureID == BoxFeature.ID():
21 aFeature = BoxFeature().__disown__()
23 elif theFeatureID == CylinderFeature.ID():
24 aFeature = CylinderFeature().__disown__()
27 raise StandardError("No such feature %s" % theFeatureID)
32 plugin = PythonFeaturesPlugin()