Commit 80f8fde6 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

getClassFromName method update

parent 8c838c71
...@@ -146,10 +146,14 @@ def getClassFromName(dotted_name): ...@@ -146,10 +146,14 @@ def getClassFromName(dotted_name):
# XXX dotted name is always Dream.Something, but the real class lives in # XXX dotted name is always Dream.Something, but the real class lives in
# dream.simulation.Something.Something # dream.simulation.Something.Something
dream, class_name = dotted_name.split('.') dream, class_name = dotted_name.split('.')
import dream.simulation as ds try:
__import__('dream.simulation.%s' % class_name) import dream.simulation as ds
return getattr(getattr(ds, class_name), class_name) __import__('dream.simulation.%s' % class_name)
return getattr(getattr(ds, class_name), class_name)
except:
_class=__import__(class_name)
return getattr(_class,class_name)
# ======================================================================= # =======================================================================
# method finding objects by ID # method finding objects by ID
# ======================================================================= # =======================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment