forked from tableau/document-api-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.py
More file actions
51 lines (37 loc) · 1.31 KB
/
action.py
File metadata and controls
51 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class ActionLink(object):
"""Action datasource element"""
def __init__(self,actiondataxml):
self._xml = actiondataxml
self._expression = self._xml.get('expression')
@property
def expression(self):
return self._expression
@expression.setter
def expression(self, value):
self._expression = value
self._xml.set('expression', value)
class ActionParam(object):
"""A class representing zone object."""
def __init__(self, actionparamXmlElement):
"""Constructor for XMl element representing zone object in dashboard XML element."""
self._actionparamXmlElement = actionparamXmlElement
self._param = self._actionparamXmlElement.get('param')
@property
def param(self):
return self._param
@param.setter
def param(self, value):
self._param = value
self._actionparamXmlElement.set('param', value)
class Action(object):
"""A class representing workbook actions."""
def __init__(self, actionxml):
self._xml = actionxml
self._link = list(map(ActionLink, self._xml.findall('./link')))
self._param = list(map(ActionParam, self._xml.findall('.//param')))
@property
def link(self):
return self._link
@property
def param(self):
return self._param