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
d9c36831
Commit
d9c36831
authored
Jun 08, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix path
parent
8928af7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+6
-4
No files found.
olapy/core/mdx/executor/execute.py
View file @
d9c36831
...
@@ -82,7 +82,7 @@ class MdxEngine:
...
@@ -82,7 +82,7 @@ class MdxEngine:
# surrended with try, except and PASS so we continue getting cubes from different
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
# sources (db, csv...) without interruption
if
cls
.
DATA_FOLDER
is
not
None
:
if
cls
.
DATA_FOLDER
is
not
None
:
home_directory
=
cls
.
DATA_FOLDER
home_directory
=
os
.
path
.
dirname
(
cls
.
DATA_FOLDER
)
elif
RUNNING_TOX
:
elif
RUNNING_TOX
:
home_directory
=
os
.
environ
.
get
(
'HOME_DIR'
)
home_directory
=
os
.
environ
.
get
(
'HOME_DIR'
)
else
:
else
:
...
@@ -90,22 +90,24 @@ class MdxEngine:
...
@@ -90,22 +90,24 @@ class MdxEngine:
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
try
:
try
:
MdxEngine
.
csv_files_cubes
=
[
MdxEngine
.
csv_files_cubes
=
[
file
for
file
in
os
.
listdir
(
location
)
file
for
file
in
os
.
listdir
(
location
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
location
,
file
))
if
os
.
path
.
isdir
(
os
.
path
.
join
(
location
,
file
))
]
]
except
Exception
:
except
Exception
:
print
(
'no csv folders'
)
print
(
'no csv folders'
)
pass
pass
# get postgres databases
# get postgres databases
# surrended with try, except and PASS so we continue getting cubes from different
# sources (db, csv...) without interruption
try
:
try
:
db
=
MyDB
(
db_config_file_path
=
cls
.
DATA_FOLDER
)
db
=
MyDB
(
db_config_file_path
=
cls
.
DATA_FOLDER
)
connection
=
db
.
engine
# TODO this work only with postgres
# TODO this work only with postgres
result
=
connection
.
execute
(
'SELECT datname FROM pg_database WHERE datistemplate = false;'
)
result
=
db
.
engine
.
execute
(
'SELECT datname FROM pg_database WHERE datistemplate = false;'
)
available_tables
=
result
.
fetchall
()
available_tables
=
result
.
fetchall
()
# cursor.execute("""SELECT datname FROM pg_database
# cursor.execute("""SELECT datname FROM pg_database
# WHERE datistemplate = false;""")
# WHERE datistemplate = false;""")
...
...
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