Salome HOME
dc4219d11d91cf038268998b30f87653127fa066
[modules/shaper.git] / src / PythonFeaturesPlugin / PythonFeaturesPlugin.py
1 import ModelAPI
2 from PythonFeaturesPlugin_Box import PythonFeaturesPlugin_Box
3
4 class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
5   
6   def __init__(self):
7     ModelAPI.ModelAPI_Plugin.__init__(self)
8     pass
9
10   def createFeature(self, theFeatureID):
11     if theFeatureID == PythonFeaturesPlugin_Box.ID():
12       return PythonFeaturesPlugin_Box()
13     else:
14       raise StandardError("No such feature %s"%theFeatureID)
15
16 plugin = PythonFeaturesPlugin()
17 aSession = ModelAPI.ModelAPI_Session.get()
18 print "Module loaded. Session", aSession
19 aSession.registerPlugin(plugin)