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,358 @@
|
|
1
|
+
## BEGIN_IMPORT
|
2
|
+
from common import VerboseGuard
|
3
|
+
from . base import *
|
4
|
+
from . element import Element
|
5
|
+
from . gameelements import GameElement
|
6
|
+
from . map import WidgetMap
|
7
|
+
from . withtraits import *
|
8
|
+
## END_IMPORT
|
9
|
+
|
10
|
+
# --------------------------------------------------------------------
|
11
|
+
class WidgetElement:
|
12
|
+
UNIQUE = ['entryName']
|
13
|
+
def __init__(self):
|
14
|
+
pass
|
15
|
+
|
16
|
+
def addTabs(self,**kwargs):
|
17
|
+
'''Add a `Tabs` element to this
|
18
|
+
|
19
|
+
Parameters
|
20
|
+
----------
|
21
|
+
kwargs : dict
|
22
|
+
Dictionary of attribute key-value pairs
|
23
|
+
|
24
|
+
Returns
|
25
|
+
-------
|
26
|
+
element : Tabs
|
27
|
+
The added element
|
28
|
+
'''
|
29
|
+
return self.add(TabWidget,**kwargs)
|
30
|
+
def addCombo(self,**kwargs):
|
31
|
+
'''Add a drop-down menu to this
|
32
|
+
|
33
|
+
Parameters
|
34
|
+
----------
|
35
|
+
Dictionary of attribute key-value pairs
|
36
|
+
|
37
|
+
Returns
|
38
|
+
-------
|
39
|
+
element : Combo
|
40
|
+
The added element
|
41
|
+
'''
|
42
|
+
return self.add(ComboWidget,**kwargs)
|
43
|
+
def addPanel(self,**kwargs):
|
44
|
+
'''Add a `Panel` element to this
|
45
|
+
|
46
|
+
Parameters
|
47
|
+
----------
|
48
|
+
kwargs : dict
|
49
|
+
Dictionary of attribute key-value pairs
|
50
|
+
|
51
|
+
Returns
|
52
|
+
-------
|
53
|
+
element : Panel
|
54
|
+
The added element
|
55
|
+
'''
|
56
|
+
return self.add(PanelWidget,**kwargs)
|
57
|
+
def addList(self,**kwargs):
|
58
|
+
'''Add a `List` element to this
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
kwargs : dict
|
63
|
+
Dictionary of attribute key-value pairs
|
64
|
+
|
65
|
+
Returns
|
66
|
+
-------
|
67
|
+
element : List
|
68
|
+
The added element
|
69
|
+
'''
|
70
|
+
return self.add(ListWidget,**kwargs)
|
71
|
+
def addMapWidget(self,**kwargs):
|
72
|
+
'''Add a `MapWidget` element to this
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
kwargs : dict
|
77
|
+
Dictionary of attribute key-value pairs
|
78
|
+
|
79
|
+
Returns
|
80
|
+
-------
|
81
|
+
element : MapWidget
|
82
|
+
The added element
|
83
|
+
'''
|
84
|
+
return self.add(MapWidget,**kwargs)
|
85
|
+
def addChart(self,**kwargs):
|
86
|
+
'''Add a `Chart` element to this
|
87
|
+
|
88
|
+
Parameters
|
89
|
+
----------
|
90
|
+
kwargs : dict
|
91
|
+
Dictionary of attribute key-value pairs
|
92
|
+
|
93
|
+
Returns
|
94
|
+
-------
|
95
|
+
element : Chart
|
96
|
+
The added element
|
97
|
+
'''
|
98
|
+
## BEGIN_IMPORT
|
99
|
+
from . chart import Chart
|
100
|
+
## END_IMPORT
|
101
|
+
return self.add(Chart,**kwargs)
|
102
|
+
def addPieceSlot(self,**kwargs):
|
103
|
+
'''Add a `PieceSlot` element to this
|
104
|
+
|
105
|
+
Parameters
|
106
|
+
----------
|
107
|
+
kwargs : dict
|
108
|
+
Dictionary of attribute key-value pairs
|
109
|
+
|
110
|
+
Returns
|
111
|
+
-------
|
112
|
+
element : PieceSlot
|
113
|
+
The added element
|
114
|
+
'''
|
115
|
+
return self.add(PieceSlot,**kwargs)
|
116
|
+
def addPiece(self,piece):
|
117
|
+
'''Add a `Piece` element to this
|
118
|
+
|
119
|
+
Parameters
|
120
|
+
----------
|
121
|
+
kwargs : dict
|
122
|
+
Dictionary of attribute key-value pairs
|
123
|
+
|
124
|
+
Returns
|
125
|
+
-------
|
126
|
+
element : Piece
|
127
|
+
The added element
|
128
|
+
'''
|
129
|
+
if not isinstance(piece,PieceSlot):
|
130
|
+
print(f'Trying to add {type(piece)} to ListWidget')
|
131
|
+
return None
|
132
|
+
|
133
|
+
p = piece.clone(self)
|
134
|
+
return p
|
135
|
+
def getTabs(self,asdict=True):
|
136
|
+
'''Get all Tab element(s) from this
|
137
|
+
|
138
|
+
Parameters
|
139
|
+
----------
|
140
|
+
asdict : bool
|
141
|
+
If `True`, return a dictonary that maps key to `Tab` elements. If `False`, return a list of all Tab` children.
|
142
|
+
|
143
|
+
Returns
|
144
|
+
-------
|
145
|
+
children : dict or list
|
146
|
+
Dictionary or list of `Tab` children
|
147
|
+
'''
|
148
|
+
return self.getElementsByKey(TabWidget,'entryName',asdict)
|
149
|
+
def getCombos(self,asdict=True):
|
150
|
+
'''Get all Combo element(s) from this
|
151
|
+
|
152
|
+
Parameters
|
153
|
+
----------
|
154
|
+
asdict : bool
|
155
|
+
If `True`, return a dictonary that maps key to `Tab` elements. If `False`, return a list of all Tab` children.
|
156
|
+
|
157
|
+
Returns
|
158
|
+
-------
|
159
|
+
children : dict or list
|
160
|
+
Dictionary or list of `Tab` children
|
161
|
+
'''
|
162
|
+
return self.getElementsByKey(ComboWidget,'entryName',asdict)
|
163
|
+
def getLists(self,asdict=True):
|
164
|
+
'''Get all List element(s) from this
|
165
|
+
|
166
|
+
Parameters
|
167
|
+
----------
|
168
|
+
asdict : bool
|
169
|
+
If `True`, return a dictonary that maps key to `List` elements. If `False`, return a list of all List` children.
|
170
|
+
|
171
|
+
Returns
|
172
|
+
-------
|
173
|
+
children : dict or list
|
174
|
+
Dictionary or list of `List` children
|
175
|
+
'''
|
176
|
+
return self.getElementsByKey(ListWidget,'entryName',asdict)
|
177
|
+
def getPanels(self,asdict=True):
|
178
|
+
'''Get all Panel element(s) from this
|
179
|
+
|
180
|
+
Parameters
|
181
|
+
----------
|
182
|
+
asdict : bool
|
183
|
+
If `True`, return a dictonary that maps key to `Panel` elements. If `False`, return a list of all Panel` children.
|
184
|
+
|
185
|
+
Returns
|
186
|
+
-------
|
187
|
+
children : dict or list
|
188
|
+
Dictionary or list of `Panel` children
|
189
|
+
'''
|
190
|
+
return self.getElementsByKey(PanelWidget,'entryName',asdict)
|
191
|
+
def getMapWidgets(self,asdict=True):
|
192
|
+
'''Get all MapWidget element(s) from this
|
193
|
+
|
194
|
+
Parameters
|
195
|
+
----------
|
196
|
+
asdict : bool
|
197
|
+
If `True`, return a dictonary that maps key to `MapWidget` elements. If `False`, return a list of all MapWidget` children.
|
198
|
+
|
199
|
+
Returns
|
200
|
+
-------
|
201
|
+
children : dict or list
|
202
|
+
Dictionary or list of `MapWidget` children
|
203
|
+
'''
|
204
|
+
return self.getElementsByKey(MapWidget,'entryName',asdict)
|
205
|
+
def getCharts(self,asdict=True):
|
206
|
+
'''Get all Chart element(s) from this
|
207
|
+
|
208
|
+
Parameters
|
209
|
+
----------
|
210
|
+
asdict : bool
|
211
|
+
If `True`, return a dictonary that maps key to `Chart` elements. If `False`, return a list of all Chart` children.
|
212
|
+
|
213
|
+
Returns
|
214
|
+
-------
|
215
|
+
children : dict or list
|
216
|
+
Dictionary or list of `Chart` children
|
217
|
+
'''
|
218
|
+
return self.getElementsByKey(Chart,'chartName',asdict)
|
219
|
+
def getPieceSlots(self,asdict=True):
|
220
|
+
'''Get all PieceSlot element(s) from this
|
221
|
+
|
222
|
+
Parameters
|
223
|
+
----------
|
224
|
+
asdict : bool
|
225
|
+
If `True`, return a dictonary that maps key to `PieceSlot` elements. If `False`, return a list of all PieceSlot` children.
|
226
|
+
|
227
|
+
Returns
|
228
|
+
-------
|
229
|
+
children : dict or list
|
230
|
+
Dictionary or list of `PieceSlot` children
|
231
|
+
'''
|
232
|
+
return self.getElementsByKey(PieceSlot,'entryName',asdict)
|
233
|
+
|
234
|
+
# --------------------------------------------------------------------
|
235
|
+
class PieceWindow(GameElement,WidgetElement):
|
236
|
+
TAG=Element.MODULE+'PieceWindow'
|
237
|
+
UNIQUE = ['name']
|
238
|
+
def __init__(self,elem,node=None,
|
239
|
+
name = '',
|
240
|
+
defaultWidth = 0,
|
241
|
+
hidden = False,
|
242
|
+
hotkey = key('C',ALT),
|
243
|
+
scale = 1.,
|
244
|
+
text = '',
|
245
|
+
tooltip = 'Show/hide piece window',
|
246
|
+
icon = '/images/counter.gif'):
|
247
|
+
super(PieceWindow,self).__init__(elem,self.TAG,node=node,
|
248
|
+
name = name,
|
249
|
+
defaultWidth = defaultWidth,
|
250
|
+
hidden = hidden,
|
251
|
+
hotkey = hotkey,
|
252
|
+
scale = scale,
|
253
|
+
text = text,
|
254
|
+
tooltip = tooltip,
|
255
|
+
icon = icon)
|
256
|
+
|
257
|
+
registerElement(PieceWindow)
|
258
|
+
|
259
|
+
# --------------------------------------------------------------------
|
260
|
+
class ComboWidget(Element,WidgetElement):
|
261
|
+
TAG=Element.WIDGET+'BoxWidget'
|
262
|
+
def __init__(self,elem,node=None,entryName='',width=0,height=0):
|
263
|
+
super(ComboWidget,self).__init__(elem,
|
264
|
+
self.TAG,
|
265
|
+
node = node,
|
266
|
+
entryName = entryName,
|
267
|
+
width = width,
|
268
|
+
height = height)
|
269
|
+
|
270
|
+
registerElement(ComboWidget)
|
271
|
+
|
272
|
+
# --------------------------------------------------------------------
|
273
|
+
class TabWidget(Element,WidgetElement):
|
274
|
+
TAG=Element.WIDGET+'TabWidget'
|
275
|
+
def __init__(self,elem,node=None,entryName=''):
|
276
|
+
super(TabWidget,self).__init__(elem,
|
277
|
+
self.TAG,
|
278
|
+
node = node,
|
279
|
+
entryName = entryName)
|
280
|
+
|
281
|
+
registerElement(TabWidget)
|
282
|
+
|
283
|
+
# --------------------------------------------------------------------
|
284
|
+
class ListWidget(Element,WidgetElement):
|
285
|
+
TAG=Element.WIDGET+'ListWidget'
|
286
|
+
def __init__(self,elem,node = None,
|
287
|
+
entryName = '',
|
288
|
+
height = 0,
|
289
|
+
width = 300,
|
290
|
+
scale = 1.,
|
291
|
+
divider = 150):
|
292
|
+
super(ListWidget,self).__init__(elem,self.TAG,node=node,
|
293
|
+
entryName = entryName,
|
294
|
+
height = height,
|
295
|
+
width = width,
|
296
|
+
scale = scale,
|
297
|
+
divider = divider)
|
298
|
+
|
299
|
+
registerElement(ListWidget)
|
300
|
+
|
301
|
+
# --------------------------------------------------------------------
|
302
|
+
class PanelWidget(Element,WidgetElement):
|
303
|
+
TAG=Element.WIDGET+'PanelWidget'
|
304
|
+
def __init__(self,elem,node=None,
|
305
|
+
entryName = '',
|
306
|
+
fixed = False,
|
307
|
+
nColumns = 1,
|
308
|
+
vert = False):
|
309
|
+
super(PanelWidget,self).__init__(elem,self.TAG,node=node,
|
310
|
+
entryName = entryName,
|
311
|
+
fixed = fixed,
|
312
|
+
nColumns = nColumns,
|
313
|
+
vert = vert)
|
314
|
+
|
315
|
+
registerElement(PanelWidget)
|
316
|
+
|
317
|
+
# --------------------------------------------------------------------
|
318
|
+
class MapWidget(Element):
|
319
|
+
TAG=Element.WIDGET+'MapWidget'
|
320
|
+
def __init__(self,elem,node=None,entryName=''):
|
321
|
+
super(MapWidget,self).__init__(elem,self.TAG,
|
322
|
+
node = node,
|
323
|
+
entryName = entryName)
|
324
|
+
|
325
|
+
def addWidgetMap(self,**kwargs):
|
326
|
+
'''Add a `WidgetMap` element to this
|
327
|
+
|
328
|
+
Parameters
|
329
|
+
----------
|
330
|
+
kwargs : dict
|
331
|
+
Dictionary of attribute key-value pairs
|
332
|
+
|
333
|
+
Returns
|
334
|
+
-------
|
335
|
+
element : WidgetMap
|
336
|
+
The added element
|
337
|
+
'''
|
338
|
+
return self.add(WidgetMap,**kwargs)
|
339
|
+
def getWidgetMaps(self,asdict=True):
|
340
|
+
'''Get all WidgetMap element(s) from this
|
341
|
+
|
342
|
+
Parameters
|
343
|
+
----------
|
344
|
+
asdict : bool
|
345
|
+
If `True`, return a dictonary that maps key to `WidgetMap` elements. If `False`, return a list of all WidgetMap` children.
|
346
|
+
|
347
|
+
Returns
|
348
|
+
-------
|
349
|
+
children : dict or list
|
350
|
+
Dictionary or list of `WidgetMap` children
|
351
|
+
'''
|
352
|
+
return self.getElementsByKey(WidgetMap,'mapName',asdict=asdict)
|
353
|
+
|
354
|
+
registerElement(MapWidget)
|
355
|
+
|
356
|
+
#
|
357
|
+
# EOF
|
358
|
+
#
|