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
5d798833
Commit
5d798833
authored
May 02, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change non pythonic variables names
parent
8092f75b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
32 deletions
+23
-32
olapy/core/services/models.py
olapy/core/services/models.py
+12
-20
olapy/core/services/xmla.py
olapy/core/services/xmla.py
+3
-4
olapy/core/services/xmla_discover_tools.py
olapy/core/services/xmla_discover_tools.py
+4
-4
olapy/core/services/xmla_discover_xsds.py
olapy/core/services/xmla_discover_xsds.py
+1
-1
olapy/web/stats_utils.py
olapy/web/stats_utils.py
+2
-2
olapy/web/templates/stats.html
olapy/web/templates/stats.html
+1
-1
No files found.
olapy/core/services/models.py
View file @
5d798833
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
.
H
ierarchy
=
Hierarchy
self
.
UN
ame
=
UName
self
.
C
aption
=
Caption
self
.
LN
ame
=
LName
self
.
LN
um
=
LNum
self
.
DisplayI
nfo
=
DisplayInfo
self
.
PARENT_UNIQUE_NAME
=
PARENT_UNIQUE_NAME
self
.
HIERARCHY_UNIQUE_NAME
=
HIERARCHY_UNIQUE_NAME
self
.
V
alue
=
Value
self
.
h
ierarchy
=
Hierarchy
self
.
un
ame
=
UName
self
.
c
aption
=
Caption
self
.
ln
ame
=
LName
self
.
ln
um
=
LNum
self
.
display_i
nfo
=
DisplayInfo
self
.
parent_unique_name
=
PARENT_UNIQUE_NAME
self
.
hierarchy_unique_name
=
HIERARCHY_UNIQUE_NAME
self
.
v
alue
=
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
.
LN
ame
,
self
.
LNum
,
self
.
DisplayInfo
,
self
.
PARENT_UNIQUE_NAME
,
self
.
HIERARCHY_UNIQUE_NAME
,
self
.
V
alue
)
"""
.
format
(
self
.
hierarchy
,
self
.
uname
,
self
.
caption
,
self
.
ln
ame
,
self
.
lnum
,
self
.
display_info
,
self
.
parent_unique_name
,
self
.
hierarchy_unique_name
,
self
.
v
alue
)
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'
olapy/core/services/xmla.py
View file @
5d798833
...
...
@@ -36,14 +36,13 @@ class XmlaProviderService(ServiceBase):
# this problem is related with Spyne architecture, NO CHOICE
discover_tools
=
XmlaDiscoverTools
()
SessionId
=
discover_tools
.
SessionI
d
sessio_id
=
discover_tools
.
session_i
d
@
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
.
SessionI
d
))
ctx
.
out_header
=
Session
(
SessionId
=
str
(
XmlaProviderService
.
sessio_i
d
))
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
.
SessionI
d
))
ctx
.
out_header
=
Session
(
SessionId
=
str
(
XmlaProviderService
.
sessio_i
d
))
if
request
.
Command
.
Statement
==
''
:
# check if command contains a query
...
...
olapy/core/services/xmla_discover_tools.py
View file @
5d798833
...
...
@@ -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
.
SessionI
d
=
uuid
.
uuid1
()
self
.
session_i
d
=
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
...
...
olapy/core/services/xmla_discover_xsds.py
View file @
5d798833
...
...
@@ -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">
...
...
olapy/web/stats_utils.py
View file @
5d798833
...
...
@@ -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
)]
graph
JSON
=
json
.
dumps
(
graphs
,
cls
=
plotly
.
utils
.
PlotlyJSONEncoder
)
graph
_json
=
json
.
dumps
(
graphs
,
cls
=
plotly
.
utils
.
PlotlyJSONEncoder
)
return
{
'ids'
:
ids
,
'graph
JSON'
:
graphJSON
}
return
{
'ids'
:
ids
,
'graph
_json'
:
graph_json
}
olapy/web/templates/stats.html
View file @
5d798833
...
...
@@ -73,7 +73,7 @@
<script
type=
"text/javascript"
>
var
graphs
=
{{
graphe
[
'
graph
JSON
'
]
|
safe
}};
var
graphs
=
{{
graphe
[
'
graph
_json
'
]
|
safe
}};
var
ids
=
{{
graphe
[
'
ids
'
]
|
safe
}};
for
(
var
i
in
graphs
)
{
Plotly
.
plot
(
...
...
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