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
2fe0efa9
Commit
2fe0efa9
authored
Apr 28, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
4239eed7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+2
-2
olapy/core/mdx/tools/connection.py
olapy/core/mdx/tools/connection.py
+9
-4
olapy/core/services/xmla.py
olapy/core/services/xmla.py
+12
-15
No files found.
olapy/core/mdx/executor/execute.py
View file @
2fe0efa9
...
...
@@ -17,6 +17,7 @@ from ..tools.connection import MyDB
RUNNING_TOX
=
'RUNTING_TOX'
in
os
.
environ
class
MdxEngine
:
"""
The principal class for executing a query
...
...
@@ -80,8 +81,7 @@ class MdxEngine:
else
:
home_directory
=
expanduser
(
"~"
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
try
:
MdxEngine
.
csv_files_cubes
=
[
...
...
olapy/core/mdx/tools/connection.py
View file @
2fe0efa9
...
...
@@ -2,17 +2,22 @@ import psycopg2 as pg
class
MyDB
(
object
):
def
__init__
(
self
,
username
=
'postgres'
,
password
=
'root'
,
db
=
None
,
host
=
'localhost'
):
def
__init__
(
self
,
username
=
'postgres'
,
password
=
'root'
,
db
=
None
,
host
=
'localhost'
):
if
db
is
None
:
self
.
connection
=
pg
.
connect
(
"user={0} password={1}"
.
format
(
username
,
password
))
else
:
try
:
self
.
connection
=
pg
.
connect
(
"user={0} password={1} dbname='{2}' host='{3}'"
.
format
(
username
,
password
,
db
,
host
))
self
.
connection
=
pg
.
connect
(
"user={0} password={1} dbname='{2}' host='{3}'"
.
format
(
username
,
password
,
db
,
host
))
except
:
print
(
"can't connect"
)
def
__del__
(
self
):
if
hasattr
(
self
,
'connection'
):
self
.
connection
.
close
()
\ No newline at end of file
self
.
connection
.
close
()
olapy/core/services/xmla.py
View file @
2fe0efa9
...
...
@@ -39,14 +39,13 @@ class XmlaProviderService(ServiceBase):
discover_tools
=
XmlaDiscoverTools
()
SessionId
=
discover_tools
.
SessionId
@
rpc
(
DiscoverRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
,
_throws
=
InvalidCredentialsError
# _throws=AuthenticationError
)
@
rpc
(
DiscoverRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
,
_throws
=
InvalidCredentialsError
# _throws=AuthenticationError
)
def
Discover
(
ctx
,
request
):
"""
the first principle function of xmla protocol
...
...
@@ -70,8 +69,7 @@ class XmlaProviderService(ServiceBase):
if
ctx
.
transport
.
req_env
[
'QUERY_STRING'
]
!=
'admin'
:
raise
InvalidCredentialsError
(
fault_string
=
'You do not have permission to access this resource'
,
fault_string
=
'You do not have permission to access this resource'
,
fault_object
=
None
)
# raise AuthenticationError()
...
...
@@ -134,11 +132,10 @@ class XmlaProviderService(ServiceBase):
# Execute function must take 2 argument ( JUST 2 ! ) Command and Properties
# we encapsulate them in ExecuteRequest object
@
rpc
(
ExecuteRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
)
@
rpc
(
ExecuteRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
)
def
Execute
(
ctx
,
request
):
"""
the second principle function of xmla protocol
...
...
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