pywargame 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pywargame/__init__.py +2 -0
- pywargame/common/__init__.py +3 -0
- pywargame/common/collector.py +87 -0
- pywargame/common/dicedraw.py +363 -0
- pywargame/common/drawdice.py +40 -0
- pywargame/common/singleton.py +22 -0
- pywargame/common/test.py +25 -0
- pywargame/common/verbose.py +59 -0
- pywargame/common/verboseguard.py +53 -0
- pywargame/cyberboard/__init__.py +18 -0
- pywargame/cyberboard/archive.py +283 -0
- pywargame/cyberboard/base.py +63 -0
- pywargame/cyberboard/board.py +462 -0
- pywargame/cyberboard/cell.py +200 -0
- pywargame/cyberboard/collect.py +49 -0
- pywargame/cyberboard/collectgbx0pwd.py +30 -0
- pywargame/cyberboard/collectgbxext.py +30 -0
- pywargame/cyberboard/collectgsnexp.py +32 -0
- pywargame/cyberboard/collectgsnext.py +30 -0
- pywargame/cyberboard/draw.py +396 -0
- pywargame/cyberboard/exporter.py +1132 -0
- pywargame/cyberboard/extractor.py +240 -0
- pywargame/cyberboard/features.py +17 -0
- pywargame/cyberboard/gamebox.py +81 -0
- pywargame/cyberboard/gbxexp.py +76 -0
- pywargame/cyberboard/gbxext.py +64 -0
- pywargame/cyberboard/gsnexp.py +147 -0
- pywargame/cyberboard/gsnext.py +59 -0
- pywargame/cyberboard/head.py +111 -0
- pywargame/cyberboard/image.py +76 -0
- pywargame/cyberboard/main.py +47 -0
- pywargame/cyberboard/mark.py +102 -0
- pywargame/cyberboard/palette.py +36 -0
- pywargame/cyberboard/piece.py +169 -0
- pywargame/cyberboard/player.py +36 -0
- pywargame/cyberboard/scenario.py +115 -0
- pywargame/cyberboard/testgrid.py +156 -0
- pywargame/cyberboard/tile.py +121 -0
- pywargame/cyberboard/tray.py +68 -0
- pywargame/cyberboard/windows.py +41 -0
- pywargame/cyberboard/zeropwd.py +45 -0
- pywargame/cyberboard.py +2728 -0
- pywargame/gbx0pwd.py +2776 -0
- pywargame/gbxextract.py +2795 -0
- pywargame/gsnexport.py +16499 -0
- pywargame/gsnextract.py +2790 -0
- pywargame/latex/__init__.py +2 -0
- pywargame/latex/collect.py +34 -0
- pywargame/latex/latexexporter.py +4010 -0
- pywargame/latex/main.py +184 -0
- pywargame/vassal/__init__.py +66 -0
- pywargame/vassal/base.py +139 -0
- pywargame/vassal/board.py +243 -0
- pywargame/vassal/buildfile.py +60 -0
- pywargame/vassal/chart.py +79 -0
- pywargame/vassal/chessclock.py +197 -0
- pywargame/vassal/collect.py +98 -0
- pywargame/vassal/collectpatch.py +28 -0
- pywargame/vassal/command.py +21 -0
- pywargame/vassal/documentation.py +322 -0
- pywargame/vassal/dumpcollect.py +28 -0
- pywargame/vassal/dumpvsav.py +28 -0
- pywargame/vassal/element.py +439 -0
- pywargame/vassal/exporter.py +89 -0
- pywargame/vassal/extension.py +101 -0
- pywargame/vassal/folder.py +103 -0
- pywargame/vassal/game.py +940 -0
- pywargame/vassal/gameelements.py +1091 -0
- pywargame/vassal/globalkey.py +127 -0
- pywargame/vassal/globalproperty.py +433 -0
- pywargame/vassal/grid.py +573 -0
- pywargame/vassal/map.py +1061 -0
- pywargame/vassal/mapelements.py +1020 -0
- pywargame/vassal/merge.py +57 -0
- pywargame/vassal/merger.py +460 -0
- pywargame/vassal/moduledata.py +275 -0
- pywargame/vassal/mrgcollect.py +31 -0
- pywargame/vassal/patch.py +44 -0
- pywargame/vassal/patchcollect.py +28 -0
- pywargame/vassal/player.py +83 -0
- pywargame/vassal/save.py +495 -0
- pywargame/vassal/skel.py +380 -0
- pywargame/vassal/trait.py +224 -0
- pywargame/vassal/traits/__init__.py +36 -0
- pywargame/vassal/traits/area.py +50 -0
- pywargame/vassal/traits/basic.py +35 -0
- pywargame/vassal/traits/calculatedproperty.py +22 -0
- pywargame/vassal/traits/cargo.py +29 -0
- pywargame/vassal/traits/click.py +41 -0
- pywargame/vassal/traits/clone.py +28 -0
- pywargame/vassal/traits/delete.py +24 -0
- pywargame/vassal/traits/deselect.py +32 -0
- pywargame/vassal/traits/dynamicproperty.py +112 -0
- pywargame/vassal/traits/globalcommand.py +55 -0
- pywargame/vassal/traits/globalhotkey.py +26 -0
- pywargame/vassal/traits/globalproperty.py +54 -0
- pywargame/vassal/traits/hide.py +67 -0
- pywargame/vassal/traits/label.py +76 -0
- pywargame/vassal/traits/layer.py +105 -0
- pywargame/vassal/traits/mark.py +20 -0
- pywargame/vassal/traits/mask.py +85 -0
- pywargame/vassal/traits/mat.py +26 -0
- pywargame/vassal/traits/moved.py +35 -0
- pywargame/vassal/traits/movefixed.py +51 -0
- pywargame/vassal/traits/nonrect.py +95 -0
- pywargame/vassal/traits/nostack.py +55 -0
- pywargame/vassal/traits/place.py +104 -0
- pywargame/vassal/traits/prototype.py +20 -0
- pywargame/vassal/traits/report.py +34 -0
- pywargame/vassal/traits/restrictaccess.py +28 -0
- pywargame/vassal/traits/restrictcommand.py +32 -0
- pywargame/vassal/traits/return.py +40 -0
- pywargame/vassal/traits/rotate.py +62 -0
- pywargame/vassal/traits/sendto.py +59 -0
- pywargame/vassal/traits/sheet.py +129 -0
- pywargame/vassal/traits/skel.py +9 -0
- pywargame/vassal/traits/stack.py +28 -0
- pywargame/vassal/traits/submenu.py +27 -0
- pywargame/vassal/traits/trail.py +61 -0
- pywargame/vassal/traits/trigger.py +72 -0
- pywargame/vassal/turn.py +272 -0
- pywargame/vassal/upgrade.py +191 -0
- pywargame/vassal/vmod.py +323 -0
- pywargame/vassal/vsav.py +100 -0
- pywargame/vassal/widget.py +358 -0
- pywargame/vassal/withtraits.py +634 -0
- pywargame/vassal/xml.py +4 -0
- pywargame/vassal/zone.py +399 -0
- pywargame/vassal.py +12500 -0
- pywargame/vmodpatch.py +12548 -0
- pywargame/vsavdump.py +12533 -0
- pywargame/vslmerge.py +13015 -0
- pywargame/wgexport.py +16689 -0
- pywargame/ztexport.py +14351 -0
- pywargame/zuntzu/__init__.py +5 -0
- pywargame/zuntzu/base.py +82 -0
- pywargame/zuntzu/collect.py +38 -0
- pywargame/zuntzu/countersheet.py +250 -0
- pywargame/zuntzu/dicehand.py +48 -0
- pywargame/zuntzu/exporter.py +936 -0
- pywargame/zuntzu/gamebox.py +154 -0
- pywargame/zuntzu/map.py +36 -0
- pywargame/zuntzu/piece.py +37 -0
- pywargame/zuntzu/scenario.py +208 -0
- pywargame/zuntzu/ztexp.py +115 -0
- pywargame-0.3.1.dist-info/METADATA +353 -0
- pywargame-0.3.1.dist-info/RECORD +150 -0
- pywargame-0.3.1.dist-info/WHEEL +5 -0
- pywargame-0.3.1.dist-info/licenses/LICENSE +5 -0
- pywargame-0.3.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
## BEGIN_IMPORT
|
2
|
+
from . base import *
|
3
|
+
from . element import ToolbarElement
|
4
|
+
## END_IMPORT
|
5
|
+
|
6
|
+
# --------------------------------------------------------------------
|
7
|
+
class GlobalKey(ToolbarElement):
|
8
|
+
## Fast filters
|
9
|
+
##
|
10
|
+
## Format:
|
11
|
+
##
|
12
|
+
## GKCTYPE|LOCATION|<location>|PROPERTY|<property>
|
13
|
+
##
|
14
|
+
## where
|
15
|
+
##
|
16
|
+
## GKCTYPE: MAP (from Global),
|
17
|
+
## MODULE (from GameGlobal)
|
18
|
+
## DECK
|
19
|
+
## COUNTER (from CounterGlobal)
|
20
|
+
##
|
21
|
+
## LOCATION: true - filter on location
|
22
|
+
## false - do not filter on location
|
23
|
+
##
|
24
|
+
## PROPERTY: true - filter on property
|
25
|
+
## false - do not filter on property
|
26
|
+
##
|
27
|
+
## <location> is
|
28
|
+
##
|
29
|
+
## TARGETTYPE|TARGETMAP|TARGETBOARD|TARGETZONE|TARGETLOCATION|TARGETX|TARGETY|TARGETDECK
|
30
|
+
##
|
31
|
+
## <property> is
|
32
|
+
##
|
33
|
+
## PROPERTYNAME|PROPERTYVALUE|COMPARE
|
34
|
+
##
|
35
|
+
## TARGETTYPE: CURSTACK current stack or deck
|
36
|
+
## CURMAP current map
|
37
|
+
## CURZONE current zone
|
38
|
+
## CURLOC current location
|
39
|
+
## MAP specified map (TARGETMAP)
|
40
|
+
## ZONE specified zone (TARGETZONE)
|
41
|
+
## LOCATION specified location (TARGETLOCATION)
|
42
|
+
## XY specified X,Y (TARGETBOARD,TARGETX,TARGETY)
|
43
|
+
## DECK specified deck (TARGETDECK)
|
44
|
+
## CURMAT current mat
|
45
|
+
##
|
46
|
+
## PROPERTYNAME
|
47
|
+
##
|
48
|
+
## PROPERTYVALUE: A constant
|
49
|
+
##
|
50
|
+
## COMPARE: EQUALS: ==
|
51
|
+
## NOT_EQUALS: !=
|
52
|
+
## GREATER: >
|
53
|
+
## GREATER_EQUALS: >=
|
54
|
+
## LESS: <
|
55
|
+
## LESS_EQUALS: <=
|
56
|
+
## MATCH: =~
|
57
|
+
## NOT_MATCH !~
|
58
|
+
##
|
59
|
+
##
|
60
|
+
SELECTED = 'MAP|false|MAP|||||0|0||true|Selected|true|EQUALS'
|
61
|
+
UNIQUE = ['name']
|
62
|
+
def __init__(self,
|
63
|
+
parent,
|
64
|
+
tag,
|
65
|
+
node = None,
|
66
|
+
name = '',
|
67
|
+
icon = '',
|
68
|
+
tooltip = '',
|
69
|
+
buttonHotkey = '',
|
70
|
+
buttonText = '',
|
71
|
+
canDisable = False,
|
72
|
+
propertyGate = '',
|
73
|
+
disabledIcon = '',
|
74
|
+
# Local
|
75
|
+
hotkey = '',
|
76
|
+
deckCount = '-1',
|
77
|
+
filter = '',
|
78
|
+
reportFormat = '',
|
79
|
+
reportSingle = False,
|
80
|
+
singleMap = True,
|
81
|
+
target = SELECTED):
|
82
|
+
'''
|
83
|
+
Parameters
|
84
|
+
----------
|
85
|
+
- tag The XML tag to use
|
86
|
+
- parent Parent node
|
87
|
+
- node Optionally existing node
|
88
|
+
- name Name of key
|
89
|
+
- buttonHotkey Key in "global" scope
|
90
|
+
- hotkey Key to send to targeted pieces
|
91
|
+
- buttonText Text on button
|
92
|
+
- canDisable If true, disabled when propertyGate is true
|
93
|
+
- deckCount Number of decks (-1 is all)
|
94
|
+
- filter Which units to target
|
95
|
+
- propertyGate When true, disable
|
96
|
+
- reportFormat Chat message
|
97
|
+
- reportSingle Also show single piece reports
|
98
|
+
- singleMap Only originating map if True
|
99
|
+
- target Preselection filter (default selected pieces)
|
100
|
+
- tooltip Hover-over message
|
101
|
+
- icon Image to use as icon
|
102
|
+
|
103
|
+
Default targets are selected units
|
104
|
+
'''
|
105
|
+
|
106
|
+
super(GlobalKey,self).\
|
107
|
+
__init__(parent,
|
108
|
+
tag,
|
109
|
+
node = node,
|
110
|
+
name = name,
|
111
|
+
icon = icon,
|
112
|
+
tooltip = tooltip,
|
113
|
+
buttonHotkey = buttonHotkey, # This hot key
|
114
|
+
buttonText = buttonText,
|
115
|
+
canDisable = canDisable,
|
116
|
+
propertyGate = propertyGate,
|
117
|
+
disabledIcon = disabledIcon,
|
118
|
+
hotkey = hotkey, # Target hot key
|
119
|
+
deckCount = deckCount,
|
120
|
+
filter = filter,
|
121
|
+
reportFormat = reportFormat,
|
122
|
+
reportSingle = reportSingle,
|
123
|
+
singleMap = singleMap,
|
124
|
+
target = target)
|
125
|
+
#
|
126
|
+
# EOF
|
127
|
+
#
|
@@ -0,0 +1,433 @@
|
|
1
|
+
## BEGIN_IMPORT
|
2
|
+
from common import VerboseGuard
|
3
|
+
from . base import *
|
4
|
+
from . element import Element
|
5
|
+
## END_IMPORT
|
6
|
+
|
7
|
+
# --------------------------------------------------------------------
|
8
|
+
class GlobalProperties(Element):
|
9
|
+
TAG = Element.MODULE+'properties.GlobalProperties'
|
10
|
+
def __init__(self,elem,node=None,**named):
|
11
|
+
super(GlobalProperties,self).__init__(elem,self.TAG,node=node)
|
12
|
+
|
13
|
+
for n, p in named:
|
14
|
+
self.addProperty(n, **p)
|
15
|
+
|
16
|
+
def getGame(self):
|
17
|
+
return self.getParent(Game)
|
18
|
+
def addProperty(self,**kwargs):
|
19
|
+
'''Add a `Property` element to this
|
20
|
+
|
21
|
+
Parameters
|
22
|
+
----------
|
23
|
+
kwargs : dict
|
24
|
+
Dictionary of attribute key-value pairs
|
25
|
+
|
26
|
+
Returns
|
27
|
+
-------
|
28
|
+
element : Property
|
29
|
+
The added element
|
30
|
+
'''
|
31
|
+
return GlobalProperty(self,node=None,**kwargs)
|
32
|
+
def addFolder(self,**kwargs):
|
33
|
+
'''Add a `ModuleFolder` element to this
|
34
|
+
|
35
|
+
Parameters
|
36
|
+
----------
|
37
|
+
kwargs : dict
|
38
|
+
Dictionary of attribute key-value pairs
|
39
|
+
|
40
|
+
Returns
|
41
|
+
-------
|
42
|
+
element : ModuleFolder
|
43
|
+
The added element
|
44
|
+
'''
|
45
|
+
return self.add(GlobalPropertyFolder,**kwargs)
|
46
|
+
|
47
|
+
def getProperties(self):
|
48
|
+
return getElementsByKey(GlobalProperty,'name')
|
49
|
+
|
50
|
+
def addScenarioTab(self,**kwargs):
|
51
|
+
'''Add a scenario property tab
|
52
|
+
|
53
|
+
Parameters
|
54
|
+
-----------
|
55
|
+
kwargs : dict
|
56
|
+
Key-value pairs to send to ScenarioOptionsTab
|
57
|
+
|
58
|
+
Returns
|
59
|
+
-------
|
60
|
+
element : ScenarioOptionsTab
|
61
|
+
Added element
|
62
|
+
'''
|
63
|
+
return ScenarioOptionsTab(self,node=None,**kwargs)
|
64
|
+
|
65
|
+
def getScenarioTabs(self):
|
66
|
+
return getElementsByKey(ScenarioOptionsTab,'name')
|
67
|
+
def getFolders(self,asdict=True):
|
68
|
+
'''Get all Menu element(s) from this
|
69
|
+
|
70
|
+
Parameters
|
71
|
+
----------
|
72
|
+
asdict : bool
|
73
|
+
If `True`, return a dictonary that maps key to `Folder`
|
74
|
+
elements. If `False`, return a list of all `Folder`
|
75
|
+
children.
|
76
|
+
|
77
|
+
Returns
|
78
|
+
-------
|
79
|
+
children : dict or list
|
80
|
+
Dictionary or list of `Folder` children
|
81
|
+
|
82
|
+
'''
|
83
|
+
return self.getElementsByKey(GlobalPropertyFolder,'name',asdict)
|
84
|
+
|
85
|
+
registerElement(GlobalProperties)
|
86
|
+
|
87
|
+
# --------------------------------------------------------------------
|
88
|
+
class GlobalProperty(Element):
|
89
|
+
TAG = Element.MODULE+'properties.GlobalProperty'
|
90
|
+
UNIQUE = ['name']
|
91
|
+
def __init__(self,
|
92
|
+
elem,
|
93
|
+
node = None,
|
94
|
+
name = '',
|
95
|
+
initialValue = '',
|
96
|
+
isNumeric = False,
|
97
|
+
min = "null",
|
98
|
+
max = "null",
|
99
|
+
wrap = False,
|
100
|
+
description = ""):
|
101
|
+
super(GlobalProperty,self).__init__(elem,self.TAG,
|
102
|
+
node = node,
|
103
|
+
name = name,
|
104
|
+
initialValue = initialValue,
|
105
|
+
isNumeric = isNumeric,
|
106
|
+
min = min,
|
107
|
+
max = max,
|
108
|
+
wrap = wrap,
|
109
|
+
description = description)
|
110
|
+
|
111
|
+
def getGlobalProperties(self):
|
112
|
+
return self.getParent(GlobalProperties)
|
113
|
+
|
114
|
+
registerElement(GlobalProperty)
|
115
|
+
|
116
|
+
# ====================================================================
|
117
|
+
class ScenarioOptionsTab(Element):
|
118
|
+
TAG = Element.MODULE+'properties.ScenarioPropertiesOptionTab'
|
119
|
+
LEFT = 'left'
|
120
|
+
RIGHT = 'right'
|
121
|
+
UNIQUE = ['name']
|
122
|
+
|
123
|
+
def __init__(self,elem,node=None,
|
124
|
+
name = 'Options',
|
125
|
+
description = 'Scenario options',
|
126
|
+
heading = '',
|
127
|
+
leftAlign = 'left',
|
128
|
+
reportFormat = ('!$PlayerId$ changed Scenario Option '
|
129
|
+
'[$tabName$] $propertyPrompt$ from '
|
130
|
+
'$oldValue$ to $newValue$')):
|
131
|
+
super(ScenarioOptionsTab,self).__init__(elem,
|
132
|
+
self.TAG,
|
133
|
+
node = node,
|
134
|
+
name = name,
|
135
|
+
description = description,
|
136
|
+
heading = heading,
|
137
|
+
leftAlign = leftAlign,
|
138
|
+
reportFormat = reportFormat)
|
139
|
+
|
140
|
+
def addList(self,**kwargs):
|
141
|
+
'''Add a list property option
|
142
|
+
|
143
|
+
Parameters
|
144
|
+
----------
|
145
|
+
kwargs : dict
|
146
|
+
Key, value pairs to initalise ScenarioOptionList
|
147
|
+
|
148
|
+
Returns
|
149
|
+
-------
|
150
|
+
element : ScenarioOption
|
151
|
+
The added element
|
152
|
+
'''
|
153
|
+
return ScenarioOptionList(self,node=None,**kwargs)
|
154
|
+
|
155
|
+
def addBoolean(self,**kwargs):
|
156
|
+
'''Add a list property option
|
157
|
+
|
158
|
+
Parameters
|
159
|
+
----------
|
160
|
+
kwargs : dict
|
161
|
+
Key, value pairs to initalise ScenarioOptionBool
|
162
|
+
|
163
|
+
Returns
|
164
|
+
-------
|
165
|
+
element : ScenarioOption
|
166
|
+
The added element
|
167
|
+
'''
|
168
|
+
return ScenarioOptionBool(self,node=None,**kwargs)
|
169
|
+
|
170
|
+
def addString(self,**kwargs):
|
171
|
+
'''Add a list property option
|
172
|
+
|
173
|
+
Parameters
|
174
|
+
----------
|
175
|
+
kwargs : dict
|
176
|
+
Key, value pairs to initalise ScenarioOptionString
|
177
|
+
|
178
|
+
Returns
|
179
|
+
-------
|
180
|
+
element : ScenarioOption
|
181
|
+
The added element
|
182
|
+
'''
|
183
|
+
return ScenarioOptionString(self,node=None,**kwargs)
|
184
|
+
|
185
|
+
def addNumber(self,**kwargs):
|
186
|
+
'''Add a list property option
|
187
|
+
|
188
|
+
Parameters
|
189
|
+
----------
|
190
|
+
kwargs : dict
|
191
|
+
Key, value pairs to initalise ScenarioOptionNumber
|
192
|
+
|
193
|
+
Returns
|
194
|
+
-------
|
195
|
+
element : ScenarioOption
|
196
|
+
The added element
|
197
|
+
'''
|
198
|
+
return ScenarioOptionString(self,node=None,**kwargs)
|
199
|
+
|
200
|
+
def getOptions(self):
|
201
|
+
return self.getElementsByKey(ScenarioOption,'name')
|
202
|
+
|
203
|
+
def getListOptions(self):
|
204
|
+
return self.getElementsByKey(ScenarioOptionList,'name')
|
205
|
+
|
206
|
+
def getBoolOptions(self):
|
207
|
+
return self.getElementsByKey(ScenarioOptionBool,'name')
|
208
|
+
|
209
|
+
def getStringOptions(self):
|
210
|
+
return self.getElementsByKey(ScenarioOptionString,'name')
|
211
|
+
|
212
|
+
def getNumberOptions(self):
|
213
|
+
return self.getElementsByKey(ScenarioOptionNumber,'name')
|
214
|
+
|
215
|
+
def getGlobalProperties(self):
|
216
|
+
return self.getParent(GlobalProperties)
|
217
|
+
|
218
|
+
registerElement(ScenarioOptionsTab)
|
219
|
+
|
220
|
+
# --------------------------------------------------------------------
|
221
|
+
class ScenarioOption(Element):
|
222
|
+
UNIQUE = ['name']
|
223
|
+
|
224
|
+
def __init__(self,
|
225
|
+
tab,
|
226
|
+
tag,
|
227
|
+
node = None,
|
228
|
+
name = '',
|
229
|
+
hotkey = '',
|
230
|
+
description = 'Set option value',
|
231
|
+
switch = False,
|
232
|
+
initialValue = '',
|
233
|
+
**kwargs):
|
234
|
+
'''
|
235
|
+
Parameters
|
236
|
+
----------
|
237
|
+
tab : ScenarioOptionsTab
|
238
|
+
Tab to add to
|
239
|
+
tag : str
|
240
|
+
Tag value (full)
|
241
|
+
name : str
|
242
|
+
Name of global property
|
243
|
+
hotkey : named-key
|
244
|
+
Key stroke to send (global key)
|
245
|
+
description : str
|
246
|
+
Text to show user
|
247
|
+
switch : bool
|
248
|
+
If true, then prompt is put to the right
|
249
|
+
initialValue : str
|
250
|
+
Initial value
|
251
|
+
kwargs : dict
|
252
|
+
Other arguments
|
253
|
+
'''
|
254
|
+
super(ScenarioOption,self).__init__(tab,
|
255
|
+
tag,
|
256
|
+
node = node,
|
257
|
+
name = name,
|
258
|
+
hotkey = hotkey,
|
259
|
+
description = description,
|
260
|
+
switch = switch,
|
261
|
+
initialValue = initialValue,
|
262
|
+
**kwargs)
|
263
|
+
|
264
|
+
def getTab(self):
|
265
|
+
return self.getParent(ScenarioOptionsTab)
|
266
|
+
|
267
|
+
# --------------------------------------------------------------------
|
268
|
+
class ScenarioOptionList(ScenarioOption):
|
269
|
+
TAG = Element.MODULE+'properties.ListScenarioProperty'
|
270
|
+
|
271
|
+
def __init__(self,
|
272
|
+
tab,
|
273
|
+
node = None,
|
274
|
+
name = '',
|
275
|
+
hotkey = '',
|
276
|
+
description = 'Set option value',
|
277
|
+
switch = False,
|
278
|
+
initialValue = None,
|
279
|
+
options = []):
|
280
|
+
'''
|
281
|
+
Parameters
|
282
|
+
----------
|
283
|
+
tag : str
|
284
|
+
Tag value (full)
|
285
|
+
name : str
|
286
|
+
Name of global property
|
287
|
+
hotkey : named-key
|
288
|
+
Key stroke to send (global key)
|
289
|
+
description : str
|
290
|
+
Text to show user
|
291
|
+
switch : bool
|
292
|
+
If true, then prompt is put to the right
|
293
|
+
initialValue : str
|
294
|
+
Initial value. If None, set to first option
|
295
|
+
options : list
|
296
|
+
Possible values
|
297
|
+
'''
|
298
|
+
opts = ','.join([str(s) for s in options])
|
299
|
+
if initialValue is None:
|
300
|
+
initialValue = opts[0]
|
301
|
+
|
302
|
+
super(ScenarioOptionList,self).__init__(tab,
|
303
|
+
self.TAG,
|
304
|
+
node = node,
|
305
|
+
name = name,
|
306
|
+
hotkey = hotkey,
|
307
|
+
description = description,
|
308
|
+
switch = switch,
|
309
|
+
initialValue = initialValue,
|
310
|
+
options = opts)
|
311
|
+
|
312
|
+
registerElement(ScenarioOptionList)
|
313
|
+
|
314
|
+
# --------------------------------------------------------------------
|
315
|
+
class ScenarioOptionBool(ScenarioOption):
|
316
|
+
TAG = Element.MODULE+'properties.BooleanScenarioProperty'
|
317
|
+
|
318
|
+
def __init__(self,
|
319
|
+
tab,
|
320
|
+
node = None,
|
321
|
+
name = '',
|
322
|
+
hotkey = '',
|
323
|
+
description = 'Set option value',
|
324
|
+
switch = False,
|
325
|
+
initialValue = False):
|
326
|
+
'''
|
327
|
+
Parameters
|
328
|
+
----------
|
329
|
+
tag : str
|
330
|
+
Tag value (full)
|
331
|
+
name : str
|
332
|
+
Name of global property
|
333
|
+
hotkey : named-key
|
334
|
+
Key stroke to send (global key)
|
335
|
+
description : str
|
336
|
+
Text to show user
|
337
|
+
switch : bool
|
338
|
+
If true, then prompt is put to the right
|
339
|
+
initialValue : bool
|
340
|
+
Initial value
|
341
|
+
'''
|
342
|
+
super(ScenarioOptionBool,self).__init__(tab,
|
343
|
+
self.TAG,
|
344
|
+
node = node,
|
345
|
+
name = name,
|
346
|
+
hotkey = hotkey,
|
347
|
+
description = description,
|
348
|
+
switch = switch,
|
349
|
+
initialValue = initialValue)
|
350
|
+
|
351
|
+
registerElement(ScenarioOptionBool)
|
352
|
+
|
353
|
+
# --------------------------------------------------------------------
|
354
|
+
class ScenarioOptionString(ScenarioOption):
|
355
|
+
TAG = Element.MODULE+'properties.StringScenarioProperty'
|
356
|
+
|
357
|
+
def __init__(self,
|
358
|
+
tab,
|
359
|
+
node = None,
|
360
|
+
name = '',
|
361
|
+
hotkey = '',
|
362
|
+
description = 'Set option value',
|
363
|
+
switch = False,
|
364
|
+
initialValue = False):
|
365
|
+
'''
|
366
|
+
Parameters
|
367
|
+
----------
|
368
|
+
tag : str
|
369
|
+
Tag value (full)
|
370
|
+
name : str
|
371
|
+
Name of global property
|
372
|
+
hotkey : named-key
|
373
|
+
Key stroke to send (global key)
|
374
|
+
description : str
|
375
|
+
Text to show user
|
376
|
+
switch : bool
|
377
|
+
If true, then prompt is put to the right
|
378
|
+
initialValue : str
|
379
|
+
Initial value
|
380
|
+
'''
|
381
|
+
super(ScenarioOptionString,self).__init__(tab,
|
382
|
+
self.TAG,
|
383
|
+
node = node,
|
384
|
+
name = name,
|
385
|
+
hotkey = hotkey,
|
386
|
+
description = description,
|
387
|
+
switch = switch,
|
388
|
+
initialValue = initialValue)
|
389
|
+
|
390
|
+
registerElement(ScenarioOptionString)
|
391
|
+
|
392
|
+
# --------------------------------------------------------------------
|
393
|
+
class ScenarioOptionNumber(ScenarioOption):
|
394
|
+
TAG = Element.MODULE+'properties.NumberScenarioProperty'
|
395
|
+
|
396
|
+
def __init__(self,
|
397
|
+
tab,
|
398
|
+
node = None,
|
399
|
+
name = '',
|
400
|
+
hotkey = '',
|
401
|
+
description = 'Set option value',
|
402
|
+
switch = False,
|
403
|
+
initialValue = False):
|
404
|
+
'''
|
405
|
+
Parameters
|
406
|
+
----------
|
407
|
+
tag : str
|
408
|
+
Tag value (full)
|
409
|
+
name : str
|
410
|
+
Name of global property
|
411
|
+
hotkey : named-key
|
412
|
+
Key stroke to send (global key)
|
413
|
+
description : str
|
414
|
+
Text to show user
|
415
|
+
switch : bool
|
416
|
+
If true, then prompt is put to the right
|
417
|
+
initialValue : str
|
418
|
+
Initial value
|
419
|
+
'''
|
420
|
+
super(ScenarioOptionNumber,self).__init__(tab,
|
421
|
+
self.TAG,
|
422
|
+
node = node,
|
423
|
+
name = name,
|
424
|
+
hotkey = hotkey,
|
425
|
+
description = description,
|
426
|
+
switch = switch,
|
427
|
+
initialValue = initialValue)
|
428
|
+
|
429
|
+
registerElement(ScenarioOptionNumber)
|
430
|
+
|
431
|
+
#
|
432
|
+
# EOF
|
433
|
+
#
|