1 """Registration of all user-defined Python features
5 from macros.box.feature import BoxFeature
8 class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
9 """Implementation of features plugin"""
13 ModelAPI.ModelAPI_Plugin.__init__(self)
14 aSession = ModelAPI.ModelAPI_Session.get()
15 aSession.registerPlugin(self)
18 def createFeature(self, theFeatureID):
19 """Create a feature by its Id"""
22 if theFeatureID == BoxFeature.ID():
23 aFeature = BoxFeature().__disown__()
26 raise StandardError("No such feature %s" % theFeatureID)
31 plugin = PythonFeaturesPlugin()