def _get_root_brain_path():
"""
Return the full path of the default brain file
:Example:
brain.brain_file = cls._get_root_brain_path()
.. raises:: IOError
.. warnings:: Static method and Private
"""
# get current script directory path. We are in /an/unknown/path/kalliope/core/ConfigurationManager
cur_script_directory = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# get parent dir. Now we are in /an/unknown/path/kalliope
parent_dir = os.path.normpath(cur_script_directory + os.sep + os.pardir + os.sep + os.pardir)
brain_path = parent_dir + os.sep + "brain.yml"
logger.debug("Real brain.yml path: %s" % brain_path)
if os.path.isfile(brain_path):
return brain_path
raise IOError("Default brain.yml file not found")
评论列表
文章目录