Commit 93df06cd authored by mouadh's avatar mouadh

not working

parent 578f642d
......@@ -115,7 +115,9 @@ class MdxEngine:
def _get_default_cube_directory(self):
# toxworkdir does not expanduser properly under tox
if RUNNING_TOX:
if 'OLAPY_PATH' in os.environ:
home_directory = os.environ.get('OLAPY_PATH')
elif RUNNING_TOX:
home_directory = os.environ.get('HOME_DIR')
else:
home_directory = expanduser("~")
......
......@@ -198,12 +198,18 @@ class ConfigParser:
:param cube_path: path to cube (csv folders)
:param file_name: config file name (DEFAULT = cubes-config.xml)
"""
if cube_path is None:
# home_directory = home_directory
if 'OLAPY_PATH' in os.environ:
home_directory = os.environ['OLAPY_PATH']
else:
from os.path import expanduser
home_directory = expanduser("~")
if cube_path is None:
self.cube_path = os.path.join(home_directory, 'olapy-data', 'cubes')
else:
self.cube_path = cube_path
self.file_name = file_name
self.web_config_file_name = web_config_file_name
......
......@@ -29,7 +29,7 @@ setup(
install_requires=install_requires,
include_package_data=False,
# cmdclass={
# # 'develop': PostDevelopCommand,
# 'develop': PostDevelopCommand,
# 'install': PostInstallCommand,
# },
classifiers=[
......@@ -42,7 +42,13 @@ setup(
],)
if RUNNING_TOX:
# if RUNNING_TOX:
# home_directory = os.environ.get('HOME_DIR')
# else:
# home_directory = expanduser("~")
if 'OLAPY_PATH' in os.environ:
home_directory = os.environ['OLAPY_PATH']
elif RUNNING_TOX:
home_directory = os.environ.get('HOME_DIR')
else:
home_directory = expanduser("~")
......@@ -55,5 +61,3 @@ if not os.path.isdir(os.path.join(home_directory, 'olapy-data', 'cubes')):
if not os.path.isfile(os.path.join(home_directory, 'olapy-data','olapy-config.xml')):
copyfile('config/olapy-config.xml', os.path.join(home_directory, 'olapy-data','olapy-config.xml'))
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