pywargame 0.4.1__py3-none-any.whl → 0.4.2__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 +7 -1
- pywargame/common/__init__.py +3 -0
- pywargame/common/drawdice.py +12 -3
- pywargame/common/test.py +2 -2
- pywargame/cyberboard/gbxext.py +13 -9
- pywargame/cyberboard/gsnexp.py +15 -10
- pywargame/cyberboard/gsnext.py +9 -7
- pywargame/cyberboard/testgrid.py +2 -1
- pywargame/cyberboard/zeropwd.py +18 -11
- pywargame/latex/latexexporter.py +7 -7
- pywargame/latex/main.py +10 -6
- pywargame/vassal/__init__.py +1 -0
- pywargame/vassal/buildfile.py +1 -1
- pywargame/vassal/collect.py +3 -2
- pywargame/vassal/collectpatch.py +2 -2
- pywargame/vassal/dumpvsav.py +7 -2
- pywargame/vassal/element.py +1 -1
- pywargame/vassal/gameelements.py +28 -11
- pywargame/vassal/merge.py +8 -5
- pywargame/vassal/moduledata.py +1 -1
- pywargame/vassal/patch.py +8 -5
- pywargame/vassal/trait.py +13 -10
- pywargame/vassal/traits/area.py +4 -2
- pywargame/vassal/traits/cargo.py +3 -0
- pywargame/vassal/traits/mat.py +3 -0
- pywargame/vassal/vmod.py +1 -1
- pywargame/zuntzu/__init__.py +9 -0
- pywargame/zuntzu/countersheet.py +1 -1
- pywargame/zuntzu/ztexp.py +10 -8
- {pywargame-0.4.1.dist-info → pywargame-0.4.2.dist-info}/METADATA +51 -31
- {pywargame-0.4.1.dist-info → pywargame-0.4.2.dist-info}/RECORD +38 -50
- pywargame-0.4.2.dist-info/entry_points.txt +11 -0
- pywargame/cyberboard.py +0 -2728
- pywargame/gbx0pwd.py +0 -2776
- pywargame/gbxextract.py +0 -2795
- pywargame/gsnexport.py +0 -16547
- pywargame/gsnextract.py +0 -2793
- pywargame/vassal/patchcollect.py +0 -28
- pywargame/vassal/skel.py +0 -380
- pywargame/vassal.py +0 -12544
- pywargame/vmodpatch.py +0 -12592
- pywargame/vsavdump.py +0 -12577
- pywargame/vslmerge.py +0 -13059
- pywargame/wgexport.py +0 -16733
- pywargame/ztexport.py +0 -14395
- /pywargame/vassal/{dumpcollect.py → collectdump.py} +0 -0
- /pywargame/vassal/{mrgcollect.py → collectmrg.py} +0 -0
- /pywargame/vassal/{xml.py → xmlns.py} +0 -0
- {pywargame-0.4.1.dist-info → pywargame-0.4.2.dist-info}/WHEEL +0 -0
- {pywargame-0.4.1.dist-info → pywargame-0.4.2.dist-info}/licenses/LICENSE +0 -0
- {pywargame-0.4.1.dist-info → pywargame-0.4.2.dist-info}/top_level.txt +0 -0
pywargame/vassal/patchcollect.py
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
import sys
|
3
|
-
sys.path.append('..')
|
4
|
-
|
5
|
-
from common import Verbose, VerboseGuard
|
6
|
-
from common.collector import Collector
|
7
|
-
|
8
|
-
|
9
|
-
if __name__ == '__main__':
|
10
|
-
from argparse import ArgumentParser, FileType
|
11
|
-
|
12
|
-
ap = ArgumentParser(description='Collect to single script')
|
13
|
-
ap.add_argument('output',
|
14
|
-
type=FileType('w'),
|
15
|
-
nargs='?',
|
16
|
-
default='vmodpatch.py',
|
17
|
-
help='Output script name')
|
18
|
-
ap.add_argument('-v','--verbose',action='store_true',
|
19
|
-
help='Be verbose')
|
20
|
-
|
21
|
-
args = ap.parse_args()
|
22
|
-
|
23
|
-
Verbose().setVerbose(args.verbose)
|
24
|
-
|
25
|
-
c = Collector()
|
26
|
-
c.run(args.output,
|
27
|
-
'vassal.py',
|
28
|
-
'patch.py')
|
pywargame/vassal/skel.py
DELETED
@@ -1,380 +0,0 @@
|
|
1
|
-
## BEGIN_IMPORT
|
2
|
-
from .. common import VerboseGuard
|
3
|
-
from . base import *
|
4
|
-
from . element import Element
|
5
|
-
## END_IMPORT
|
6
|
-
|
7
|
-
# --------------------------------------------------------------------
|
8
|
-
class GameElement(Element):
|
9
|
-
def __init__(self,game,tag,node=None,**kwargs):
|
10
|
-
super(GameElement,self).__init__(game,tag,node=node,**kwargs)
|
11
|
-
|
12
|
-
def getGame(self):
|
13
|
-
return self.getParent(Game)
|
14
|
-
|
15
|
-
|
16
|
-
# --------------------------------------------------------------------
|
17
|
-
class Notes(GameElement):
|
18
|
-
TAG = Element.MODULE+'NotesWindow'
|
19
|
-
def __init__(self,elem,node=None,
|
20
|
-
name = 'Notes',
|
21
|
-
buttonText = '',
|
22
|
-
hotkey = key('N',ALT),
|
23
|
-
icon = '/images/notes.gif',
|
24
|
-
tooltip = 'Show notes window'):
|
25
|
-
super(Notes,self).__init__(elem,self.TAG,node=node,
|
26
|
-
name = name,
|
27
|
-
buttonText = buttonText,
|
28
|
-
hotkey = hotkey,
|
29
|
-
icon = icon,
|
30
|
-
tooltip = tooltip)
|
31
|
-
def encode(self):
|
32
|
-
return ['NOTES\t\\','PNOTES']
|
33
|
-
|
34
|
-
registerElement(Notes)
|
35
|
-
|
36
|
-
# --------------------------------------------------------------------
|
37
|
-
class PredefinedSetup(GameElement):
|
38
|
-
TAG = Element.MODULE+'PredefinedSetup'
|
39
|
-
def __init__(self,elem,node=None,
|
40
|
-
name = '',
|
41
|
-
file = '',
|
42
|
-
useFile = False,
|
43
|
-
isMenu = False,
|
44
|
-
description = ''):
|
45
|
-
useFile = ((useFile or not isMenu) and
|
46
|
-
(file is not None and len(file) > 0))
|
47
|
-
if file is None: file = ''
|
48
|
-
super(PredefinedSetup,self).__init__(elem,self.TAG,node=node,
|
49
|
-
name = name,
|
50
|
-
file = file,
|
51
|
-
useFile = useFile,
|
52
|
-
isMenu = isMenu,
|
53
|
-
description = description)
|
54
|
-
def addPredefinedSetup(self,**kwargs):
|
55
|
-
'''Add a `PredefinedSetup` element to this
|
56
|
-
|
57
|
-
Parameters
|
58
|
-
----------
|
59
|
-
kwargs : dict
|
60
|
-
Dictionary of attribute key-value pairs
|
61
|
-
Returns
|
62
|
-
-------
|
63
|
-
element : PredefinedSetup
|
64
|
-
The added element
|
65
|
-
'''
|
66
|
-
return self.add(PredefinedSetup,**kwargs)
|
67
|
-
def getPredefinedSetups(self,asdict=True):
|
68
|
-
'''Get all PredefinedSetup element(s) from this
|
69
|
-
|
70
|
-
Parameters
|
71
|
-
----------
|
72
|
-
asdict : bool
|
73
|
-
If `True`, return a dictonary that maps key to `PredefinedSetup` elements. If `False`, return a list of all PredefinedSetup` children.
|
74
|
-
Returns
|
75
|
-
-------
|
76
|
-
children : dict or list
|
77
|
-
Dictionary or list of `PredefinedSetup` children
|
78
|
-
'''
|
79
|
-
return self.getElementsByKey(PredefinedSetup,'name',asdict)
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
registerElement(PredefinedSetup)
|
85
|
-
|
86
|
-
# --------------------------------------------------------------------
|
87
|
-
class GlobalTranslatableMessages(GameElement):
|
88
|
-
TAG=Element.MODULE+'properties.GlobalTranslatableMessages'
|
89
|
-
def __init__(self,elem,node=None):
|
90
|
-
'''Translations
|
91
|
-
|
92
|
-
Parameters
|
93
|
-
----------
|
94
|
-
doc : Element
|
95
|
-
Parent
|
96
|
-
node : xml.dom.Element
|
97
|
-
Node to read state from
|
98
|
-
'''
|
99
|
-
super(GlobalTranslatableMessages,self).\
|
100
|
-
__init__(elem,self.TAG,node=node)
|
101
|
-
|
102
|
-
registerElement(GlobalTranslatableMessages)
|
103
|
-
|
104
|
-
# --------------------------------------------------------------------
|
105
|
-
class Language(GameElement):
|
106
|
-
TAG = 'VASSAL.i18n.Language'
|
107
|
-
def __init__(self,elem,node=None,**kwargs):
|
108
|
-
super(Languate,self).__init__(sele,self.TAG,node=none,**kwargs)
|
109
|
-
|
110
|
-
registerElement(Language)
|
111
|
-
|
112
|
-
# --------------------------------------------------------------------
|
113
|
-
class Chatter(GameElement):
|
114
|
-
TAG=Element.MODULE+'Chatter'
|
115
|
-
def __init__(self,elem,node=None,**kwargs):
|
116
|
-
'''Chat
|
117
|
-
|
118
|
-
Parameters
|
119
|
-
----------
|
120
|
-
doc : Element
|
121
|
-
Parent
|
122
|
-
node : xml.dom.Element
|
123
|
-
Node to read state from
|
124
|
-
kwargs : dict
|
125
|
-
Attributes
|
126
|
-
'''
|
127
|
-
super(Chatter,self).__init__(elem,self.TAG,node=node,**kwargs)
|
128
|
-
|
129
|
-
registerElement(Chatter)
|
130
|
-
|
131
|
-
# --------------------------------------------------------------------
|
132
|
-
class KeyNamer(GameElement):
|
133
|
-
TAG=Element.MODULE+'KeyNamer'
|
134
|
-
def __init__(self,elem,node=None,**kwargs):
|
135
|
-
'''Key namer (or help menu)
|
136
|
-
|
137
|
-
Parameters
|
138
|
-
----------
|
139
|
-
doc : Element
|
140
|
-
Parent
|
141
|
-
node : xml.dom.Element
|
142
|
-
Node to read state from
|
143
|
-
kwargs : dict
|
144
|
-
Attributes
|
145
|
-
'''
|
146
|
-
super(KeyNamer,self).__init__(elem,self.TAG,node=node,**kwargs)
|
147
|
-
|
148
|
-
registerElement(KeyNamer)
|
149
|
-
|
150
|
-
# --------------------------------------------------------------------
|
151
|
-
class GlobalOptions(GameElement):
|
152
|
-
TAG = Element.MODULE+'GlobalOptions'
|
153
|
-
def __init__(self,doc,node=None,
|
154
|
-
autoReport = "Use Preferences Setting",
|
155
|
-
centerOnMove = "Use Preferences Setting",
|
156
|
-
chatterHTMLSupport = "Always",
|
157
|
-
hotKeysOnClosedWindows = "Never",
|
158
|
-
inventoryForAll = "Always",
|
159
|
-
nonOwnerUnmaskable = "Use Preferences Setting",
|
160
|
-
playerIdFormat = "$playerName$",
|
161
|
-
promptString = "Opponents can unmask pieces",
|
162
|
-
sendToLocationMoveTrails = "Never"):
|
163
|
-
'''Set global options on the module
|
164
|
-
|
165
|
-
Parameters
|
166
|
-
----------
|
167
|
-
doc : Element
|
168
|
-
Parent
|
169
|
-
node : xml.dom.Element
|
170
|
-
Node to read state from
|
171
|
-
autoReport : str Option
|
172
|
-
centerOnMove : str Option
|
173
|
-
chatterHTMLSupport : str Option
|
174
|
-
hotKeysOnClosedWindows : str Option
|
175
|
-
inventoryForAll : str Option
|
176
|
-
nonOwnerUnmaskable : str Option
|
177
|
-
playerIdFormat : str Option
|
178
|
-
promptString : str Option
|
179
|
-
sendToLocationMoveTrails : str Option
|
180
|
-
'''
|
181
|
-
super(GlobalOptions,self).\
|
182
|
-
__init__(doc,self.TAG,node=node,
|
183
|
-
autoReport = autoReport,
|
184
|
-
centerOnMove = centerOnMove,
|
185
|
-
chatterHTMLSupport = chatterHTMLSupport,
|
186
|
-
hotKeysOnClosedWindows = hotKeysOnClosedWindows,
|
187
|
-
inventoryForAll = inventoryForAll,
|
188
|
-
nonOwnerUnmaskable = nonOwnerUnmaskable,
|
189
|
-
playerIdFormat = playerIdFormat,
|
190
|
-
promptString = promptString,
|
191
|
-
sendToLocationMoveTrails = sendToLocationMoveTrails)
|
192
|
-
|
193
|
-
def addOption(self,**kwargs):
|
194
|
-
'''Add a `Option` element to this
|
195
|
-
|
196
|
-
Parameters
|
197
|
-
----------
|
198
|
-
kwargs : dict
|
199
|
-
Dictionary of attribute key-value pairs
|
200
|
-
Returns
|
201
|
-
-------
|
202
|
-
element : Option
|
203
|
-
The added element
|
204
|
-
'''
|
205
|
-
return self.add(Option,**kwargs)
|
206
|
-
def getOptions(self):
|
207
|
-
return self.getElementsByKey(Option,'name')
|
208
|
-
|
209
|
-
registerElement(GlobalOptions)
|
210
|
-
|
211
|
-
|
212
|
-
# --------------------------------------------------------------------
|
213
|
-
class Option(Element):
|
214
|
-
TAG = 'option'
|
215
|
-
def __init__(self,doc,node=None,name='',value=''):
|
216
|
-
super(Option,self).__init__(doc,node=node,name=name)
|
217
|
-
self._root.addText(self._node,value)
|
218
|
-
|
219
|
-
def getGlobalOptions(self):
|
220
|
-
return self.getParent(GlobalOptions)
|
221
|
-
|
222
|
-
registerElement(Option)
|
223
|
-
|
224
|
-
# --------------------------------------------------------------------
|
225
|
-
# CurrentMap == "Board"
|
226
|
-
class Inventory(GameElement):
|
227
|
-
TAG = Element.MODULE+'Inventory'
|
228
|
-
def __init__(self,doc,node=None,
|
229
|
-
canDisable = False,
|
230
|
-
centerOnPiece = True,
|
231
|
-
disabledIcon = '',
|
232
|
-
drawPieces = True,
|
233
|
-
foldersOnly = False,
|
234
|
-
forwardKeystroke = True,
|
235
|
-
groupBy = '',
|
236
|
-
hotkey = key('I',ALT),
|
237
|
-
icon = '/images/inventory.gif',
|
238
|
-
include = '{}',
|
239
|
-
launchFunction = 'functionHide',
|
240
|
-
leafFormat = '$PieceName$',
|
241
|
-
name = '',
|
242
|
-
nonLeafFormat = '$PropertyValue$',
|
243
|
-
pieceZoom = '0.33',
|
244
|
-
pieceZoom2 = '0.5',
|
245
|
-
pieceZoom3 = '0.6',
|
246
|
-
propertyGate = '',
|
247
|
-
refreshHotkey = key('I',ALT_SHIFT),
|
248
|
-
showMenu = True,
|
249
|
-
sides = '',
|
250
|
-
sortFormat = '$PieceName$',
|
251
|
-
sortPieces = True,
|
252
|
-
sorting = 'alpha',
|
253
|
-
text = '',
|
254
|
-
tooltip = 'Show inventory of all pieces',
|
255
|
-
zoomOn = False):
|
256
|
-
super(Inventory,self).__init__(doc,self.TAG,node=node,
|
257
|
-
canDisable = canDisable,
|
258
|
-
centerOnPiece = centerOnPiece,
|
259
|
-
disabledIcon = disabledIcon,
|
260
|
-
drawPieces = drawPieces,
|
261
|
-
foldersOnly = foldersOnly,
|
262
|
-
forwardKeystroke = forwardKeystroke,
|
263
|
-
groupBy = groupBy,
|
264
|
-
hotkey = hotkey,
|
265
|
-
icon = icon,
|
266
|
-
include = include,
|
267
|
-
launchFunction = launchFunction,
|
268
|
-
leafFormat = leafFormat,
|
269
|
-
name = name,
|
270
|
-
nonLeafFormat = nonLeafFormat,
|
271
|
-
pieceZoom = pieceZoom,
|
272
|
-
pieceZoom2 = pieceZoom2,
|
273
|
-
pieceZoom3 = pieceZoom3,
|
274
|
-
propertyGate = propertyGate,
|
275
|
-
refreshHotkey = refreshHotkey,
|
276
|
-
showMenu = showMenu,
|
277
|
-
sides = sides,
|
278
|
-
sortFormat = sortFormat,
|
279
|
-
sortPieces = sortPieces,
|
280
|
-
sorting = sorting,
|
281
|
-
text = text,
|
282
|
-
tooltip = tooltip,
|
283
|
-
zoomOn = zoomOn)
|
284
|
-
|
285
|
-
registerElement(Inventory)
|
286
|
-
|
287
|
-
# --------------------------------------------------------------------
|
288
|
-
class Prototypes(GameElement):
|
289
|
-
TAG = Element.MODULE+'PrototypesContainer'
|
290
|
-
def __init__(self,game,node=None,**kwargs):
|
291
|
-
super(Prototypes,self).\
|
292
|
-
__init__(game,self.TAG,node=node,**kwargs)
|
293
|
-
|
294
|
-
def addPrototype(self,**kwargs):
|
295
|
-
'''Add a `Prototype` element to this
|
296
|
-
|
297
|
-
Parameters
|
298
|
-
----------
|
299
|
-
kwargs : dict
|
300
|
-
Dictionary of attribute key-value pairs
|
301
|
-
Returns
|
302
|
-
-------
|
303
|
-
element : Prototype
|
304
|
-
The added element
|
305
|
-
'''
|
306
|
-
return self.add(Prototype,**kwargs)
|
307
|
-
def getPrototypes(self,asdict=True):
|
308
|
-
'''Get all Prototype element(s) from this
|
309
|
-
|
310
|
-
Parameters
|
311
|
-
----------
|
312
|
-
asdict : bool
|
313
|
-
If `True`, return a dictonary that maps key to `Prototype` elements. If `False`, return a list of all Prototype` children.
|
314
|
-
Returns
|
315
|
-
-------
|
316
|
-
children : dict or list
|
317
|
-
Dictionary or list of `Prototype` children
|
318
|
-
'''
|
319
|
-
return self.getElementsByKey(Prototype,'name',asdict=asdict)
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
registerElement(Prototypes)
|
324
|
-
|
325
|
-
# --------------------------------------------------------------------
|
326
|
-
class DiceButton(GameElement):
|
327
|
-
TAG=Element.MODULE+'DiceButton'
|
328
|
-
def __init__(self,elem,node=None,
|
329
|
-
addToTotal = 0,
|
330
|
-
canDisable = False,
|
331
|
-
hotkey = key('6',ALT),
|
332
|
-
icon = '/images/die.gif',
|
333
|
-
keepCount = 1,
|
334
|
-
keepDice = False,
|
335
|
-
keepOption = '>',
|
336
|
-
lockAdd = False,
|
337
|
-
lockDice = False,
|
338
|
-
lockPlus = False,
|
339
|
-
lockSides = False,
|
340
|
-
nDice = 1,
|
341
|
-
nSides = 6,
|
342
|
-
name = '1d6',
|
343
|
-
plus = 0,
|
344
|
-
prompt = False,
|
345
|
-
propertyGate = '',
|
346
|
-
reportFormat = '** $name$ = $result$ *** <$PlayerName$>;',
|
347
|
-
reportTotal = False,
|
348
|
-
sortDice = False,
|
349
|
-
text = '1d6',
|
350
|
-
tooltip = 'Roll a 1d6'):
|
351
|
-
super(DiceButton,self).\
|
352
|
-
__init__(elem,self.TAG,node=node,
|
353
|
-
addToTotal = addToTotal,
|
354
|
-
canDisable = canDisable,
|
355
|
-
hotkey = hotkey,
|
356
|
-
icon = icon,
|
357
|
-
keepCount = keepCount,
|
358
|
-
keepDice = keepDice,
|
359
|
-
keepOption = keepOption,
|
360
|
-
lockAdd = lockAdd,
|
361
|
-
lockDice = lockDice,
|
362
|
-
lockPlus = lockPlus,
|
363
|
-
lockSides = lockSides,
|
364
|
-
nDice = nDice,
|
365
|
-
nSides = nSides,
|
366
|
-
name = name,
|
367
|
-
plus = plus,
|
368
|
-
prompt = prompt,
|
369
|
-
propertyGate = propertyGate,
|
370
|
-
reportFormat = reportFormat,
|
371
|
-
reportTotal = reportTotal,
|
372
|
-
sortDice = sortDice,
|
373
|
-
text = text,
|
374
|
-
tooltip = tooltip)
|
375
|
-
|
376
|
-
registerElement(DiceButton)
|
377
|
-
|
378
|
-
#
|
379
|
-
# EOF
|
380
|
-
#
|