Commit 2fe0efa9 authored by mouadh's avatar mouadh

format

parent 4239eed7
...@@ -17,6 +17,7 @@ from ..tools.connection import MyDB ...@@ -17,6 +17,7 @@ from ..tools.connection import MyDB
RUNNING_TOX = 'RUNTING_TOX' in os.environ RUNNING_TOX = 'RUNTING_TOX' in os.environ
class MdxEngine: class MdxEngine:
""" """
The principal class for executing a query The principal class for executing a query
...@@ -80,8 +81,7 @@ class MdxEngine: ...@@ -80,8 +81,7 @@ class MdxEngine:
else: else:
home_directory = expanduser("~") home_directory = expanduser("~")
location = os.path.join(home_directory, 'olapy-data', location = os.path.join(home_directory, 'olapy-data', cls.CUBE_FOLDER)
cls.CUBE_FOLDER)
try: try:
MdxEngine.csv_files_cubes = [ MdxEngine.csv_files_cubes = [
......
...@@ -2,14 +2,19 @@ import psycopg2 as pg ...@@ -2,14 +2,19 @@ import psycopg2 as pg
class MyDB(object): 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: if db is None:
self.connection = pg.connect( self.connection = pg.connect(
"user={0} password={1}".format(username, password)) "user={0} password={1}".format(username, password))
else: else:
try: try:
self.connection = pg.connect("user={0} password={1} dbname='{2}' host='{3}'". self.connection = pg.connect(
format(username, password, db,host)) "user={0} password={1} dbname='{2}' host='{3}'".format(
username, password, db, host))
except: except:
print("can't connect") print("can't connect")
......
...@@ -39,8 +39,7 @@ class XmlaProviderService(ServiceBase): ...@@ -39,8 +39,7 @@ class XmlaProviderService(ServiceBase):
discover_tools = XmlaDiscoverTools() discover_tools = XmlaDiscoverTools()
SessionId = discover_tools.SessionId SessionId = discover_tools.SessionId
@rpc( @rpc(DiscoverRequest,
DiscoverRequest,
_returns=AnyXml, _returns=AnyXml,
_body_style="bare", _body_style="bare",
_out_header=Session, _out_header=Session,
...@@ -70,8 +69,7 @@ class XmlaProviderService(ServiceBase): ...@@ -70,8 +69,7 @@ class XmlaProviderService(ServiceBase):
if ctx.transport.req_env['QUERY_STRING'] != 'admin': if ctx.transport.req_env['QUERY_STRING'] != 'admin':
raise InvalidCredentialsError( raise InvalidCredentialsError(
fault_string= fault_string='You do not have permission to access this resource',
'You do not have permission to access this resource',
fault_object=None) fault_object=None)
# raise AuthenticationError() # raise AuthenticationError()
...@@ -134,8 +132,7 @@ class XmlaProviderService(ServiceBase): ...@@ -134,8 +132,7 @@ class XmlaProviderService(ServiceBase):
# Execute function must take 2 argument ( JUST 2 ! ) Command and Properties # Execute function must take 2 argument ( JUST 2 ! ) Command and Properties
# we encapsulate them in ExecuteRequest object # we encapsulate them in ExecuteRequest object
@rpc( @rpc(ExecuteRequest,
ExecuteRequest,
_returns=AnyXml, _returns=AnyXml,
_body_style="bare", _body_style="bare",
_out_header=Session) _out_header=Session)
......
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