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.
11 PythonFeaturesPlugin() -> plugin object
15 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
16 ModelAPI.ModelAPI_Plugin.__init__(self)
17 aSession = ModelAPI.ModelAPI_Session.get()
18 aSession.registerPlugin(self)
21 def createFeature(self, theFeatureID):
22 """Override ModelAPI_Plugin.createFeature()"""
25 if theFeatureID == BoxFeature.ID():
26 aFeature = BoxFeature().__disown__()
29 raise StandardError("No such feature %s" % theFeatureID)
34 plugin = PythonFeaturesPlugin()