Commit 2fe0efa9 authored by mouadh's avatar mouadh

format

parent 4239eed7
......@@ -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 = [
......
......@@ -2,14 +2,19 @@ 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")
......
......@@ -39,8 +39,7 @@ class XmlaProviderService(ServiceBase):
discover_tools = XmlaDiscoverTools()
SessionId = discover_tools.SessionId
@rpc(
DiscoverRequest,
@rpc(DiscoverRequest,
_returns=AnyXml,
_body_style="bare",
_out_header=Session,
......@@ -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,8 +132,7 @@ class XmlaProviderService(ServiceBase):
# Execute function must take 2 argument ( JUST 2 ! ) Command and Properties
# we encapsulate them in ExecuteRequest object
@rpc(
ExecuteRequest,
@rpc(ExecuteRequest,
_returns=AnyXml,
_body_style="bare",
_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