CMS 3D CMS Logo

Functions

GetScenario Namespace Reference

Functions

def getScenario

Function Documentation

def GetScenario::getScenario (   scenarioName)
_getScenario_

Util to load the scenario implementation.

Assumes that module exists at:

Configuration.DataProcessing.Impl.<scenarioName>.py

Definition at line 12 of file GetScenario.py.

00013                              :
00014     """
00015     _getScenario_
00016 
00017     Util to load the scenario implementation.
00018 
00019     Assumes that module exists at:
00020 
00021     Configuration.DataProcessing.Impl.<scenarioName>.py
00022     
00023     """
00024     moduleName = "Configuration.DataProcessing.Impl.%s" % scenarioName
00025     try:
00026         module = __import__(moduleName,
00027                             globals(), locals(), [scenarioName])#, -1)
00028     except ImportError, ex:
00029         msg = "Unable to load Scenario Module:\n"
00030         msg += "%s\n%s\n" % (moduleName, str(ex))
00031         raise RuntimeError, msg
00032     instance = getattr(module, scenarioName, None)
00033     if instance == None:
00034         msg = "Unable to retrieve instance of Scenario class:"
00035         msg += "%s\n From Module\n%s" % (scenarioName, moduleName)
00036     return instance()
00037 
00038