Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
82e81c97
Commit
82e81c97
authored
Jun 30, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix path
parent
5c0df274
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+9
-5
No files found.
olapy/core/mdx/executor/execute.py
View file @
82e81c97
...
...
@@ -80,21 +80,25 @@ class MdxEngine:
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
if
cls
.
DATA_FOLDER
is
not
None
:
if
'OLAPY_PATH'
in
os
.
environ
:
home_directory
=
os
.
environ
.
get
(
'OLAPY_PATH'
)
elif
cls
.
DATA_FOLDER
is
not
None
:
home_directory
=
os
.
path
.
dirname
(
cls
.
DATA_FOLDER
)
elif
RUNNING_TOX
:
home_directory
=
os
.
environ
.
get
(
'HOME_DIR'
)
else
:
home_directory
=
expanduser
(
"~"
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
olapy_data_location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
)
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
cubes_location
=
os
.
path
.
join
(
olapy_data_location
,
cls
.
CUBE_FOLDER
)
try
:
MdxEngine
.
csv_files_cubes
=
[
file
for
file
in
os
.
listdir
(
location
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
location
,
file
))
file
for
file
in
os
.
listdir
(
cubes_
location
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
cubes_
location
,
file
))
]
except
Exception
:
print
(
'no csv folders'
)
...
...
@@ -104,7 +108,7 @@ class MdxEngine:
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
try
:
db
=
MyDB
(
db_config_file_path
=
cls
.
DATA_FOLDER
)
db
=
MyDB
(
db_config_file_path
=
olapy_data_location
)
# TODO this work only with postgres
result
=
db
.
engine
.
execute
(
'SELECT datname FROM pg_database WHERE datistemplate = false;'
)
available_tables
=
result
.
fetchall
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment