CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.

References instance.

12 
13 def getScenario(scenarioName):
14  """
15  _getScenario_
16 
17  Util to load the scenario implementation.
18 
19  Assumes that module exists at:
20 
21  Configuration.DataProcessing.Impl.<scenarioName>.py
22 
23  """
24  moduleName = "Configuration.DataProcessing.Impl.%s" % scenarioName
25  try:
26  module = __import__(moduleName,
27  globals(), locals(), [scenarioName])#, -1)
28  except ImportError, ex:
29  msg = "Unable to load Scenario Module:\n"
30  msg += "%s\n%s\n" % (moduleName, str(ex))
31  raise RuntimeError, msg
32  instance = getattr(module, scenarioName, None)
33  if instance == None:
34  msg = "Unable to retrieve instance of Scenario class:"
35  msg += "%s\n From Module\n%s" % (scenarioName, moduleName)
36  return instance()
37 
38 
static PFTauRenderPlugin instance
def getScenario
Definition: GetScenario.py:12