dfpyre 0.4.5__py3-none-any.whl → 0.5.0__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.
Potentially problematic release.
This version of dfpyre might be problematic. Click here for more details.
- dfpyre/data/data.json +1 -1
- dfpyre/items.py +279 -361
- dfpyre/pyre.py +405 -433
- dfpyre/style.py +22 -22
- {dfpyre-0.4.5.dist-info → dfpyre-0.5.0.dist-info}/LICENSE +21 -21
- {dfpyre-0.4.5.dist-info → dfpyre-0.5.0.dist-info}/METADATA +105 -81
- dfpyre-0.5.0.dist-info/RECORD +9 -0
- dfpyre-0.4.5.dist-info/RECORD +0 -9
- {dfpyre-0.4.5.dist-info → dfpyre-0.5.0.dist-info}/WHEEL +0 -0
dfpyre/items.py
CHANGED
|
@@ -1,361 +1,279 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Contains class definitions for code items.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from enum import Enum
|
|
6
|
-
from typing import Literal, Dict
|
|
7
|
-
from dfpyre.style import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class item:
|
|
16
|
-
"""
|
|
17
|
-
Represents a Minecraft item.
|
|
18
|
-
"""
|
|
19
|
-
type = 'item'
|
|
20
|
-
|
|
21
|
-
def
|
|
22
|
-
self.
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
self.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
self.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
self.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
self.
|
|
147
|
-
self.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
self.
|
|
200
|
-
self.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
self.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
def
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
"""
|
|
281
|
-
Represents a DiamondFire vector object.
|
|
282
|
-
"""
|
|
283
|
-
type = 'vec'
|
|
284
|
-
|
|
285
|
-
def __init__(self, x: float=0.0, y: float=0.0, z: float=0.0):
|
|
286
|
-
self.x = float(x)
|
|
287
|
-
self.y = float(y)
|
|
288
|
-
self.z = float(z)
|
|
289
|
-
|
|
290
|
-
def format(self, slot: int|None):
|
|
291
|
-
formattedDict = {
|
|
292
|
-
"item": {
|
|
293
|
-
"id": self.type,
|
|
294
|
-
"data": {
|
|
295
|
-
"x": self.x,
|
|
296
|
-
"y": self.y,
|
|
297
|
-
"z": self.z
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
_add_slot(formattedDict, slot)
|
|
302
|
-
return formattedDict
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
PARAMETER_TYPE_LOOKUP = ['txt', 'comp', 'num', 'loc', 'vec', 'snd', 'part', 'pot', 'item', 'any', 'var', 'list', 'dict']
|
|
306
|
-
|
|
307
|
-
class ParameterType(Enum):
|
|
308
|
-
STRING = 0
|
|
309
|
-
TEXT = 1
|
|
310
|
-
NUMBER = 2
|
|
311
|
-
LOCATION = 3
|
|
312
|
-
VECTOR = 4
|
|
313
|
-
SOUND = 5
|
|
314
|
-
PARTICLE = 6
|
|
315
|
-
POTION_EFFECT = 7
|
|
316
|
-
ITEM = 8
|
|
317
|
-
ANY = 9
|
|
318
|
-
VAR = 10
|
|
319
|
-
LIST = 11
|
|
320
|
-
DICT = 12
|
|
321
|
-
|
|
322
|
-
def get_string_value(self) -> str:
|
|
323
|
-
return PARAMETER_TYPE_LOOKUP[self.value]
|
|
324
|
-
|
|
325
|
-
class parameter:
|
|
326
|
-
"""
|
|
327
|
-
Represents a DiamondFire parameter object.
|
|
328
|
-
"""
|
|
329
|
-
type = 'pn_el'
|
|
330
|
-
|
|
331
|
-
def __init__(self, name: str, paramType: ParameterType, plural: bool=False, optional: bool=False, description: str="", note: str="", defaultValue=None):
|
|
332
|
-
self.name = name
|
|
333
|
-
self.paramType = paramType
|
|
334
|
-
self.plural = plural
|
|
335
|
-
self.optional = optional
|
|
336
|
-
self.description = description
|
|
337
|
-
self.note = note
|
|
338
|
-
self.defaultValue = defaultValue
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
def format(self, slot: int):
|
|
342
|
-
formattedDict = {
|
|
343
|
-
"item": {
|
|
344
|
-
"id": self.type,
|
|
345
|
-
"data": {
|
|
346
|
-
"name": self.name,
|
|
347
|
-
"type": self.paramType.get_string_value(),
|
|
348
|
-
"plural": self.plural,
|
|
349
|
-
"optional": self.optional,
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
"slot": slot
|
|
353
|
-
}
|
|
354
|
-
if self.description:
|
|
355
|
-
formattedDict['item']['data']['description'] = self.description
|
|
356
|
-
if self.note:
|
|
357
|
-
formattedDict['item']['data']['note'] = self.note
|
|
358
|
-
if self.defaultValue is not None and not self.plural and self.optional:
|
|
359
|
-
formattedDict['item']['data']['default_value'] = self.defaultValue.format(None)['item']
|
|
360
|
-
|
|
361
|
-
return formattedDict
|
|
1
|
+
"""
|
|
2
|
+
Contains class definitions for code items.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import Literal, Dict
|
|
7
|
+
from dfpyre.style import is_ampersand_coded, ampersand_to_minimessage
|
|
8
|
+
from mcitemlib.itemlib import Item as NbtItem
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _add_slot(d: Dict, slot: int|None):
|
|
12
|
+
if slot is not None:
|
|
13
|
+
d['slot'] = slot
|
|
14
|
+
|
|
15
|
+
class item(NbtItem):
|
|
16
|
+
"""
|
|
17
|
+
Represents a Minecraft item.
|
|
18
|
+
"""
|
|
19
|
+
type = 'item'
|
|
20
|
+
|
|
21
|
+
def format(self, slot: int|None):
|
|
22
|
+
formatted_dict = {"item": {"id": self.type, "data": {"item": self.get_nbt()}}}
|
|
23
|
+
_add_slot(formatted_dict, slot)
|
|
24
|
+
return formatted_dict
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class string:
|
|
28
|
+
"""
|
|
29
|
+
Represents a DiamondFire string object. (`txt`)
|
|
30
|
+
"""
|
|
31
|
+
type = 'txt'
|
|
32
|
+
|
|
33
|
+
def __init__(self, value: str):
|
|
34
|
+
self.value = value
|
|
35
|
+
|
|
36
|
+
def format(self, slot: int|None):
|
|
37
|
+
formatted_dict = {"item": {"id": self.type, "data": {"name": self.value}}}
|
|
38
|
+
_add_slot(formatted_dict, slot)
|
|
39
|
+
return formatted_dict
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class text:
|
|
43
|
+
"""
|
|
44
|
+
Represents a DiamondFire styled text object (`comp`)
|
|
45
|
+
"""
|
|
46
|
+
type = 'comp'
|
|
47
|
+
|
|
48
|
+
def __init__(self, value: str):
|
|
49
|
+
if is_ampersand_coded(value):
|
|
50
|
+
value = ampersand_to_minimessage(value)
|
|
51
|
+
self.value = value
|
|
52
|
+
|
|
53
|
+
def format(self, slot: int|None):
|
|
54
|
+
formatted_dict = {"item": {"id": self.type, "data": {"name": self.value}}}
|
|
55
|
+
_add_slot(formatted_dict, slot)
|
|
56
|
+
return formatted_dict
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class num:
|
|
60
|
+
"""
|
|
61
|
+
Represents a DiamondFire number object.
|
|
62
|
+
"""
|
|
63
|
+
type = 'num'
|
|
64
|
+
|
|
65
|
+
def __init__(self, num: int|float):
|
|
66
|
+
self.value = num
|
|
67
|
+
|
|
68
|
+
def format(self, slot: int|None):
|
|
69
|
+
formatted_dict = {"item": {"id": self.type, "data": {"name": str(self.value)}}}
|
|
70
|
+
_add_slot(formatted_dict, slot)
|
|
71
|
+
return formatted_dict
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class loc:
|
|
75
|
+
"""
|
|
76
|
+
Represents a DiamondFire location object.
|
|
77
|
+
"""
|
|
78
|
+
type = 'loc'
|
|
79
|
+
|
|
80
|
+
def __init__(self, x: float=0, y: float=0, z: float=0, pitch: float=0, yaw: float=0):
|
|
81
|
+
self.x = float(x)
|
|
82
|
+
self.y = float(y)
|
|
83
|
+
self.z = float(z)
|
|
84
|
+
self.pitch = float(pitch)
|
|
85
|
+
self.yaw = float(yaw)
|
|
86
|
+
|
|
87
|
+
def format(self, slot: int|None):
|
|
88
|
+
formatted_dict = {"item": {
|
|
89
|
+
"id": self.type,
|
|
90
|
+
"data": {
|
|
91
|
+
"isBlock": False,
|
|
92
|
+
"loc": {
|
|
93
|
+
"x": self.x,
|
|
94
|
+
"y": self.y,
|
|
95
|
+
"z": self.z,
|
|
96
|
+
"pitch": self.pitch,
|
|
97
|
+
"yaw": self.yaw
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}}
|
|
101
|
+
_add_slot(formatted_dict, slot)
|
|
102
|
+
return formatted_dict
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class var:
|
|
106
|
+
"""
|
|
107
|
+
Represents a DiamondFire variable object.
|
|
108
|
+
"""
|
|
109
|
+
type = 'var'
|
|
110
|
+
|
|
111
|
+
def __init__(self, name: str, scope: Literal['unsaved', 'saved', 'local', 'line']='unsaved'):
|
|
112
|
+
self.name = name
|
|
113
|
+
self.scope = scope
|
|
114
|
+
|
|
115
|
+
def format(self, slot: int|None):
|
|
116
|
+
formatted_dict = {"item": {"id": self.type,"data": {"name": self.name, "scope": self.scope}}}
|
|
117
|
+
_add_slot(formatted_dict, slot)
|
|
118
|
+
return formatted_dict
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class sound:
|
|
122
|
+
"""
|
|
123
|
+
Represents a DiamondFire sound object.
|
|
124
|
+
"""
|
|
125
|
+
type = 'snd'
|
|
126
|
+
|
|
127
|
+
def __init__(self, name: str, pitch: float=1.0, vol: float=2.0):
|
|
128
|
+
self.name = name
|
|
129
|
+
self.pitch = pitch
|
|
130
|
+
self.vol = vol
|
|
131
|
+
|
|
132
|
+
def format(self, slot: int|None):
|
|
133
|
+
formatted_dict = {"item": {"id": self.type,"data": {"sound": self.name, "pitch": self.pitch, "vol": self.vol}}}
|
|
134
|
+
_add_slot(formatted_dict, slot)
|
|
135
|
+
return formatted_dict
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class particle:
|
|
139
|
+
"""
|
|
140
|
+
Represents a DiamondFire particle object.
|
|
141
|
+
"""
|
|
142
|
+
type = 'part'
|
|
143
|
+
def __init__(self, name: str='Cloud', amount: int=1, horizontal: float=0.0, vertical: float=0.0,
|
|
144
|
+
x: float=1.0, y: float=0.0, z: float=0.0, motionVariation: float=100):
|
|
145
|
+
self.name = name
|
|
146
|
+
self.amount = amount
|
|
147
|
+
self.horizontal = horizontal
|
|
148
|
+
self.vertical = vertical
|
|
149
|
+
self.x = x
|
|
150
|
+
self.y = y
|
|
151
|
+
self.z = z
|
|
152
|
+
self.motionVariation = motionVariation
|
|
153
|
+
|
|
154
|
+
def format(self, slot: int|None):
|
|
155
|
+
formatted_dict = {"item": {"id": self.type,
|
|
156
|
+
"data": {
|
|
157
|
+
"particle": self.name,
|
|
158
|
+
"cluster": {
|
|
159
|
+
"amount": self.amount,
|
|
160
|
+
"horizontal": self.horizontal,
|
|
161
|
+
"vertical": self.vertical
|
|
162
|
+
},
|
|
163
|
+
"data": {
|
|
164
|
+
"x": self.x,
|
|
165
|
+
"y": self.y,
|
|
166
|
+
"z": self.z,
|
|
167
|
+
"motionVariation": self.motionVariation
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}}
|
|
171
|
+
_add_slot(formatted_dict, slot)
|
|
172
|
+
return formatted_dict
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class potion:
|
|
176
|
+
"""
|
|
177
|
+
Represents a DiamondFire potion object.
|
|
178
|
+
"""
|
|
179
|
+
type = 'pot'
|
|
180
|
+
|
|
181
|
+
def __init__(self, name: str, dur: int=1000000, amp: int=0):
|
|
182
|
+
self.name = name
|
|
183
|
+
self.dur = dur
|
|
184
|
+
self.amp = amp
|
|
185
|
+
|
|
186
|
+
def format(self, slot: int|None):
|
|
187
|
+
formatted_dict = {"item": {"id": self.type,"data": {"pot": self.name, "dur": self.dur, "amp": self.amp}}}
|
|
188
|
+
_add_slot(formatted_dict, slot)
|
|
189
|
+
return formatted_dict
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class gamevalue:
|
|
193
|
+
"""
|
|
194
|
+
Represents a DiamondFire game value object.
|
|
195
|
+
"""
|
|
196
|
+
type = 'g_val'
|
|
197
|
+
|
|
198
|
+
def __init__(self, name: str, target: str='Default'):
|
|
199
|
+
self.name = name
|
|
200
|
+
self.target = target
|
|
201
|
+
|
|
202
|
+
def format(self, slot: int|None):
|
|
203
|
+
formatted_dict = {"item": {"id": self.type, "data": {"type": self.name, "target": self.target}}}
|
|
204
|
+
_add_slot(formatted_dict, slot)
|
|
205
|
+
return formatted_dict
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class vector:
|
|
209
|
+
"""
|
|
210
|
+
Represents a DiamondFire vector object.
|
|
211
|
+
"""
|
|
212
|
+
type = 'vec'
|
|
213
|
+
|
|
214
|
+
def __init__(self, x: float=0.0, y: float=0.0, z: float=0.0):
|
|
215
|
+
self.x = float(x)
|
|
216
|
+
self.y = float(y)
|
|
217
|
+
self.z = float(z)
|
|
218
|
+
|
|
219
|
+
def format(self, slot: int|None):
|
|
220
|
+
formatted_dict = {"item": {"id": self.type, "data": {"x": self.x, "y": self.y, "z": self.z}}}
|
|
221
|
+
_add_slot(formatted_dict, slot)
|
|
222
|
+
return formatted_dict
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
PARAMETER_TYPE_LOOKUP = ['txt', 'comp', 'num', 'loc', 'vec', 'snd', 'part', 'pot', 'item', 'any', 'var', 'list', 'dict']
|
|
226
|
+
|
|
227
|
+
class ParameterType(Enum):
|
|
228
|
+
STRING = 0
|
|
229
|
+
TEXT = 1
|
|
230
|
+
NUMBER = 2
|
|
231
|
+
LOCATION = 3
|
|
232
|
+
VECTOR = 4
|
|
233
|
+
SOUND = 5
|
|
234
|
+
PARTICLE = 6
|
|
235
|
+
POTION_EFFECT = 7
|
|
236
|
+
ITEM = 8
|
|
237
|
+
ANY = 9
|
|
238
|
+
VAR = 10
|
|
239
|
+
LIST = 11
|
|
240
|
+
DICT = 12
|
|
241
|
+
|
|
242
|
+
def get_string_value(self) -> str:
|
|
243
|
+
return PARAMETER_TYPE_LOOKUP[self.value]
|
|
244
|
+
|
|
245
|
+
class parameter:
|
|
246
|
+
"""
|
|
247
|
+
Represents a DiamondFire parameter object.
|
|
248
|
+
"""
|
|
249
|
+
type = 'pn_el'
|
|
250
|
+
|
|
251
|
+
def __init__(self, name: str, param_type: ParameterType, plural: bool=False, optional: bool=False, description: str="", note: str="", default_value=None):
|
|
252
|
+
self.name = name
|
|
253
|
+
self.param_type = param_type
|
|
254
|
+
self.plural = plural
|
|
255
|
+
self.optional = optional
|
|
256
|
+
self.description = description
|
|
257
|
+
self.note = note
|
|
258
|
+
self.default_value = default_value
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def format(self, slot: int):
|
|
262
|
+
formatted_dict = {"item": {
|
|
263
|
+
"id": self.type,
|
|
264
|
+
"data": {
|
|
265
|
+
"name": self.name,
|
|
266
|
+
"type": self.param_type.get_string_value(),
|
|
267
|
+
"plural": self.plural,
|
|
268
|
+
"optional": self.optional,
|
|
269
|
+
}},
|
|
270
|
+
"slot": slot
|
|
271
|
+
}
|
|
272
|
+
if self.description:
|
|
273
|
+
formatted_dict['item']['data']['description'] = self.description
|
|
274
|
+
if self.note:
|
|
275
|
+
formatted_dict['item']['data']['note'] = self.note
|
|
276
|
+
if self.default_value is not None and not self.plural and self.optional:
|
|
277
|
+
formatted_dict['item']['data']['default_value'] = self.default_value.format(None)['item']
|
|
278
|
+
|
|
279
|
+
return formatted_dict
|