Commit 5d798833 authored by mouadh's avatar mouadh

change non pythonic variables names

parent 8092f75b
from __future__ import absolute_import, division, print_function
from spyne import ComplexModel, Integer, Unicode, XmlAttribute
from spyne.model.fault import Fault
class Tuple(object):
def __init__(self, Hierarchy, UName, Caption, LName, LNum, DisplayInfo,
PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, Value):
self.Hierarchy = Hierarchy
self.UName = UName
self.Caption = Caption
self.LName = LName
self.LNum = LNum
self.DisplayInfo = DisplayInfo
self.PARENT_UNIQUE_NAME = PARENT_UNIQUE_NAME
self.HIERARCHY_UNIQUE_NAME = HIERARCHY_UNIQUE_NAME
self.Value = Value
self.hierarchy = Hierarchy
self.uname = UName
self.caption = Caption
self.lname = LName
self.lnum = LNum
self.display_info = DisplayInfo
self.parent_unique_name = PARENT_UNIQUE_NAME
self.hierarchy_unique_name = HIERARCHY_UNIQUE_NAME
self.value = Value
def __str__(self):
return """
......@@ -29,9 +27,9 @@ class Tuple(object):
PARENT_UNIQUE_NAME : {6}
HIERARCHY_UNIQUE_NAME : {7}
Value : {8}
""".format(self.Hierarchy, self.UName, self.Caption, self.LName,
self.LNum, self.DisplayInfo, self.PARENT_UNIQUE_NAME,
self.HIERARCHY_UNIQUE_NAME, self.Value)
""".format(self.hierarchy, self.uname, self.caption, self.lname,
self.lnum, self.display_info, self.parent_unique_name,
self.hierarchy_unique_name, self.value)
class Property(ComplexModel):
......@@ -105,9 +103,3 @@ class DiscoverRequest(ComplexModel):
RequestType = Unicode
Restrictions = Restrictionlist
Properties = Propertielist
# class AuthenticationError(Fault):
# __namespace__ = 'spyne.examples.authentication'
# faultcode='Client.AuthenticationError',
# faultstring='Invalid authentication request'
......@@ -36,14 +36,13 @@ class XmlaProviderService(ServiceBase):
# this problem is related with Spyne architecture, NO CHOICE
discover_tools = XmlaDiscoverTools()
SessionId = discover_tools.SessionId
sessio_id = discover_tools.session_id
@rpc(DiscoverRequest,
_returns=AnyXml,
_body_style="bare",
_out_header=Session,
_throws=InvalidCredentialsError
# _throws=AuthenticationError
)
def Discover(ctx, request):
"""
......@@ -59,7 +58,7 @@ class XmlaProviderService(ServiceBase):
# (which cause problems when we want to access xmla_provider instantiation variables)
discover_tools = XmlaProviderService.discover_tools
ctx.out_header = Session(SessionId=str(XmlaProviderService.SessionId))
ctx.out_header = Session(SessionId=str(XmlaProviderService.sessio_id))
config_parser = ConfigParser(discover_tools.executer.cube_path)
if config_parser.xmla_authentication():
......@@ -143,7 +142,7 @@ class XmlaProviderService(ServiceBase):
:return: Execute response in xml format
"""
ctx.out_header = Session(SessionId=str(XmlaProviderService.SessionId))
ctx.out_header = Session(SessionId=str(XmlaProviderService.sessio_id))
if request.Command.Statement == '':
# check if command contains a query
......
......@@ -18,7 +18,7 @@ from .xmla_discover_xsds import (dbschema_catalogs_xsd, dbschema_tables_xsd,
mdschema_measuresgroups_dimensions_xsd,
mdschema_measuresgroups_xsd,
mdschema_members_xsd,
mdschema_properties_PROPERTIES_xsd,
mdschema_properties_properties_xsd,
mdschema_sets_xsd)
......@@ -37,7 +37,7 @@ class XmlaDiscoverTools():
col for col in self.executer.load_star_schema_dataframe.columns
if col[-3:] != "_id"
]]
self.SessionId = uuid.uuid1()
self.session_id = uuid.uuid1()
def change_catalogue(self, new_catalogue):
"""
......@@ -2248,7 +2248,7 @@ class XmlaDiscoverTools():
</root>
</return>
""".format(self.selected_catalogue,
mdschema_properties_PROPERTIES_xsd))
mdschema_properties_properties_xsd))
elif request.Restrictions.RestrictionList.PROPERTY_TYPE == 1:
return etree.fromstring("""
<return>
......@@ -2258,7 +2258,7 @@ class XmlaDiscoverTools():
{0}
</root>
</return>
""".format(mdschema_properties_PROPERTIES_xsd))
""".format(mdschema_properties_properties_xsd))
def discover_mdschema_members_response(self, request):
# Enumeration of hierarchies in all dimensions
......
......@@ -623,7 +623,7 @@ xmlns:sql="urn:schemas-microsoft-com:xml-sql">
</xsd:schema>
"""
mdschema_properties_PROPERTIES_xsd = """
mdschema_properties_properties_xsd = """
<xsd:schema elementFormDefault="qualified"
targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">
......
......@@ -77,6 +77,6 @@ class Graphs:
# Add "ids" to each of the graphs to pass up to the client
# for templating
ids = ['graph-{}'.format(i) for i, _ in enumerate(graphs)]
graphJSON = json.dumps(graphs, cls=plotly.utils.PlotlyJSONEncoder)
graph_json = json.dumps(graphs, cls=plotly.utils.PlotlyJSONEncoder)
return {'ids': ids, 'graphJSON': graphJSON}
return {'ids': ids, 'graph_json': graph_json}
......@@ -73,7 +73,7 @@
<script type="text/javascript">
var graphs = {{graphe['graphJSON'] | safe}};
var graphs = {{graphe['graph_json'] | safe}};
var ids = {{graphe['ids'] | safe}};
for (var i in graphs) {
Plotly.plot(
......
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