krpctools 0.5.0__zip → 0.5.4__zip
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.
- {krpctools-0.5.0 → krpctools-0.5.4}/CHANGES.txt +6 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/COPYING +4 -4
- {krpctools-0.5.0 → krpctools-0.5.4}/LICENSE +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/PKG-INFO +1 -1
- krpctools-0.5.4/VERSION.txt +1 -0
- krpctools-0.5.4/krpctools/bin/Google.Protobuf.dll +0 -0
- krpctools-0.5.4/krpctools/bin/KRPC.Core.dll +0 -0
- krpctools-0.5.0/krpctools/bin/KRPC.xml → krpctools-0.5.4/krpctools/bin/KRPC.Core.xml +1166 -1427
- krpctools-0.5.4/krpctools/bin/KRPC.IO.Ports.dll +0 -0
- krpctools-0.5.4/krpctools/bin/Newtonsoft.Json.dll +0 -0
- krpctools-0.5.4/krpctools/bin/ServiceDefinitions.exe +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Core.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Xml.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.dll +0 -0
- krpctools-0.5.4/krpctools/bin/TestServer-0.5.4.zip +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/mscorlib.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/generator.py +3 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/python.py +118 -39
- krpctools-0.5.4/krpctools/clientgen/python.tmpl +289 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cnano.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cpp.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/java.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/nodes.py +3 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/python.tmpl +2 -8
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/python.py +8 -4
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/servicedefs/__init__.py +15 -2
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/TestService.json +42 -2
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-cnano.txt +34 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-cpp.txt +45 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-csharp.txt +21 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-TestService-java.txt +35 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgentest.py +6 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-cnano.rst +61 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-cpp.rst +61 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-csharp.rst +12 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-java.rst +62 -49
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-lua.rst +14 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-TestService-python.rst +66 -92
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgentest.py +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/utils.py +2 -2
- krpctools-0.5.4/krpctools/version.py +1 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/PKG-INFO +1 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/SOURCES.txt +4 -3
- krpctools-0.5.0/VERSION.txt +0 -1
- krpctools-0.5.0/krpctools/bin/Google.Protobuf.dll +0 -0
- krpctools-0.5.0/krpctools/bin/KRPC.dll +0 -0
- krpctools-0.5.0/krpctools/bin/Newtonsoft.Json.dll +0 -0
- krpctools-0.5.0/krpctools/bin/ServiceDefinitions.exe +0 -0
- krpctools-0.5.0/krpctools/bin/TestServer-0.5.0.zip +0 -0
- krpctools-0.5.0/krpctools/clientgen/python.tmpl +0 -111
- krpctools-0.5.0/krpctools/version.py +0 -1
- {krpctools-0.5.0 → krpctools-0.5.4}/MANIFEST.in +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/README.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/NDesk.Options.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.IO.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/bin/System.Runtime.dll +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cnano.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/cpp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/csharp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/docparser.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/clientgen/java.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/csharp.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/docgen.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/domain.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/extensions.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/lua.tmpl +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/python.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/docgen/utils.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/language.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/lang/lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/Empty.json +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/__init__.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-cnano.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-cpp.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-csharp.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/clientgen-Empty-java.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-cnano.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-cpp.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-csharp.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-java.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-lua.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/docgen-Empty-python.rst +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_clientgen_java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_cnano.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_cpp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_csharp.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_java.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_lua.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools/test/test_docgen_python.py +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/dependency_links.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/entry_points.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/requires.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/krpctools.egg-info/top_level.txt +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/setup.cfg +0 -0
- {krpctools-0.5.0 → krpctools-0.5.4}/setup.py +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -55,6 +55,7 @@ class Generator:
|
|
|
55
55
|
if 'default_value' in parameter:
|
|
56
56
|
value = decode_default_value(parameter['default_value'], typ)
|
|
57
57
|
info['default_value'] = self.parse_default_value(value, typ)
|
|
58
|
+
info['nullable'] = parameter.get('nullable', False)
|
|
58
59
|
parameters.append(info)
|
|
59
60
|
return parameters
|
|
60
61
|
|
|
@@ -65,6 +66,8 @@ class Generator:
|
|
|
65
66
|
context = {
|
|
66
67
|
'service_name': self._service,
|
|
67
68
|
'service_id': self._defs['id'],
|
|
69
|
+
'service_documentation': self.parse_documentation(
|
|
70
|
+
self._defs.get('documentation', '')),
|
|
68
71
|
'procedures': {},
|
|
69
72
|
'properties': {},
|
|
70
73
|
'classes': {},
|
|
@@ -3,6 +3,7 @@ import itertools
|
|
|
3
3
|
from krpc.types import \
|
|
4
4
|
ValueType, ClassType, EnumerationType, MessageType, \
|
|
5
5
|
TupleType, ListType, SetType, DictionaryType
|
|
6
|
+
import krpc.schema.KRPC_pb2 as KRPC
|
|
6
7
|
from krpc.utils import snake_case
|
|
7
8
|
from .generator import Generator
|
|
8
9
|
from .docparser import DocParser
|
|
@@ -14,32 +15,80 @@ class PythonGenerator(Generator):
|
|
|
14
15
|
|
|
15
16
|
language = PythonLanguage()
|
|
16
17
|
|
|
17
|
-
def
|
|
18
|
+
def parse_python_type(self, typ):
|
|
18
19
|
if typ is None:
|
|
19
20
|
return 'None'
|
|
20
21
|
if isinstance(typ, ValueType):
|
|
21
|
-
|
|
22
|
+
mapping = {
|
|
23
|
+
KRPC.Type.DOUBLE: 'double',
|
|
24
|
+
KRPC.Type.FLOAT: 'float',
|
|
25
|
+
KRPC.Type.SINT32: 'sint32',
|
|
26
|
+
KRPC.Type.SINT64: 'sint64',
|
|
27
|
+
KRPC.Type.UINT32: 'uint32',
|
|
28
|
+
KRPC.Type.UINT64: 'uint64',
|
|
29
|
+
KRPC.Type.BOOL: 'bool',
|
|
30
|
+
KRPC.Type.STRING: 'string',
|
|
31
|
+
KRPC.Type.BYTES: 'bytes'
|
|
32
|
+
}
|
|
33
|
+
return 'self._client._types.%s_type' % \
|
|
34
|
+
mapping[typ.protobuf_type.code]
|
|
22
35
|
if isinstance(typ, MessageType):
|
|
23
|
-
return self.
|
|
36
|
+
return 'self._client._types.%s_type' % \
|
|
37
|
+
snake_case(typ.python_type.__name__)
|
|
24
38
|
if isinstance(typ, ClassType):
|
|
25
|
-
return self.
|
|
39
|
+
return 'self._client._types.class_type("%s", "%s")' % \
|
|
40
|
+
(typ.protobuf_type.service, typ.protobuf_type.name)
|
|
26
41
|
if isinstance(typ, EnumerationType):
|
|
27
|
-
return self.
|
|
42
|
+
return 'self._client._types.enumeration_type("%s", "%s")' % \
|
|
43
|
+
(typ.protobuf_type.service, typ.protobuf_type.name)
|
|
28
44
|
if isinstance(typ, TupleType):
|
|
29
|
-
return '
|
|
45
|
+
return 'self._client._types.tuple_type(%s)' % \
|
|
46
|
+
', '.join(self.parse_python_type(x) for x in typ.value_types)
|
|
47
|
+
if isinstance(typ, ListType):
|
|
48
|
+
return 'self._client._types.list_type(%s)' % \
|
|
49
|
+
self.parse_python_type(typ.value_type)
|
|
50
|
+
if isinstance(typ, SetType):
|
|
51
|
+
return 'self._client._types.set_type(%s)' % \
|
|
52
|
+
self.parse_python_type(typ.value_type)
|
|
53
|
+
if isinstance(typ, DictionaryType):
|
|
54
|
+
return 'self._client._types.dictionary_type(%s, %s)' % \
|
|
55
|
+
(self.parse_python_type(typ.key_type),
|
|
56
|
+
self.parse_python_type(typ.value_type))
|
|
57
|
+
raise RuntimeError('Unknown type ' + typ)
|
|
58
|
+
|
|
59
|
+
def parse_type_specification(self, typ, is_nullable=False):
|
|
60
|
+
if typ is None:
|
|
61
|
+
spec = 'None'
|
|
62
|
+
elif isinstance(typ, ValueType):
|
|
63
|
+
spec = self.language.parse_type(typ)
|
|
64
|
+
elif isinstance(typ, MessageType):
|
|
65
|
+
if typ.python_type == KRPC.Event:
|
|
66
|
+
spec = 'Event'
|
|
67
|
+
else:
|
|
68
|
+
return 'KRPC_pb2.%s' % typ.python_type.__name__
|
|
69
|
+
elif isinstance(typ, (ClassType, EnumerationType)):
|
|
70
|
+
spec = typ.protobuf_type.name
|
|
71
|
+
if typ.protobuf_type.service != self.service_name:
|
|
72
|
+
spec = typ.protobuf_type.service.lower() + "." + spec
|
|
73
|
+
elif isinstance(typ, TupleType):
|
|
74
|
+
spec = 'Tuple[%s]' % \
|
|
30
75
|
','.join(self.parse_type_specification(t)
|
|
31
76
|
for t in typ.value_types)
|
|
32
|
-
|
|
33
|
-
|
|
77
|
+
elif isinstance(typ, ListType):
|
|
78
|
+
spec = 'List[%s]' % \
|
|
34
79
|
self.parse_type_specification(typ.value_type)
|
|
35
|
-
|
|
36
|
-
|
|
80
|
+
elif isinstance(typ, SetType):
|
|
81
|
+
spec = 'Set[%s]' % \
|
|
37
82
|
self.parse_type_specification(typ.value_type)
|
|
38
|
-
|
|
39
|
-
|
|
83
|
+
elif isinstance(typ, DictionaryType):
|
|
84
|
+
spec = 'Dict[%s, %s]' % \
|
|
40
85
|
(self.parse_type_specification(typ.key_type),
|
|
41
86
|
self.parse_type_specification(typ.value_type))
|
|
42
|
-
|
|
87
|
+
else:
|
|
88
|
+
raise RuntimeError('Unknown type ' + typ)
|
|
89
|
+
if is_nullable:
|
|
90
|
+
return 'Optional[%s]' % spec
|
|
91
|
+
return spec
|
|
43
92
|
|
|
44
93
|
def parse_context(self, context):
|
|
45
94
|
# Expand service properties into get and set methods
|
|
@@ -145,16 +194,22 @@ class PythonGenerator(Generator):
|
|
|
145
194
|
for info in procedures:
|
|
146
195
|
info['return_type'] = {
|
|
147
196
|
'name': info['return_type'],
|
|
197
|
+
'python_type': self.parse_python_type(
|
|
198
|
+
self.get_return_type(info['procedure'])
|
|
199
|
+
),
|
|
148
200
|
'spec': self.parse_type_specification(
|
|
149
|
-
self.get_return_type(info['procedure'])
|
|
201
|
+
self.get_return_type(info['procedure']),
|
|
202
|
+
info['procedure'].get('return_is_nullable', False))
|
|
150
203
|
}
|
|
151
204
|
pos = 0
|
|
152
205
|
for i, pinfo in enumerate(info['parameters']):
|
|
153
206
|
ptype = as_type(
|
|
154
207
|
self.types, info['procedure']['parameters'][i]['type'])
|
|
208
|
+
nullable = info['procedure']['parameters'][i].get('nullable', False)
|
|
155
209
|
pinfo['type'] = {
|
|
156
210
|
'name': pinfo['type'],
|
|
157
|
-
'
|
|
211
|
+
'python_type': self.parse_python_type(ptype),
|
|
212
|
+
'spec': self.parse_type_specification(ptype, nullable)
|
|
158
213
|
}
|
|
159
214
|
pos += 1
|
|
160
215
|
|
|
@@ -166,74 +221,98 @@ class PythonGenerator(Generator):
|
|
|
166
221
|
for info in items:
|
|
167
222
|
info['return_type'] = {
|
|
168
223
|
'name': info['return_type'],
|
|
224
|
+
'python_type': self.parse_python_type(
|
|
225
|
+
self.get_return_type(info['procedure'])
|
|
226
|
+
),
|
|
169
227
|
'spec': self.parse_type_specification(
|
|
170
|
-
self.get_return_type(info['procedure'])
|
|
228
|
+
self.get_return_type(info['procedure']),
|
|
229
|
+
info['procedure'].get('return_is_nullable', False))
|
|
171
230
|
}
|
|
172
231
|
pos = 0
|
|
173
232
|
for i, pinfo in enumerate(info['parameters']):
|
|
174
233
|
ptype = as_type(
|
|
175
234
|
self.types,
|
|
176
235
|
info['procedure']['parameters'][i+1]['type'])
|
|
236
|
+
nullable = info['procedure']['parameters'][i+1].get('nullable', False)
|
|
177
237
|
pinfo['type'] = {
|
|
178
238
|
'name': pinfo['type'],
|
|
179
|
-
'
|
|
239
|
+
'python_type': self.parse_python_type(ptype),
|
|
240
|
+
'spec': self.parse_type_specification(ptype, nullable)
|
|
180
241
|
}
|
|
181
242
|
pos += 1
|
|
182
243
|
|
|
183
244
|
return context
|
|
184
245
|
|
|
246
|
+
def parse_default_value(self, value, typ):
|
|
247
|
+
result = super().parse_default_value(value, typ)
|
|
248
|
+
# Fix references to types within the same service
|
|
249
|
+
prefix = self.service_name + "."
|
|
250
|
+
if result.startswith(prefix):
|
|
251
|
+
result = result[len(prefix):]
|
|
252
|
+
return result
|
|
253
|
+
|
|
185
254
|
@staticmethod
|
|
186
255
|
def parse_documentation(documentation):
|
|
187
256
|
documentation = PythonDocParser().parse(documentation)
|
|
188
|
-
if documentation ==
|
|
257
|
+
if len(documentation) == 0:
|
|
189
258
|
return ''
|
|
190
|
-
|
|
191
|
-
# content = content.replace(' <param', '<param')
|
|
192
|
-
# content = content.replace(' <returns', '<returns')
|
|
193
|
-
# content = content.replace(' <remarks', '<remarks')
|
|
194
|
-
return documentation
|
|
259
|
+
return '"""\n' + documentation + '\n"""'
|
|
195
260
|
|
|
196
261
|
|
|
197
262
|
class PythonDocParser(DocParser):
|
|
263
|
+
language = PythonLanguage()
|
|
264
|
+
|
|
198
265
|
def parse_summary(self, node):
|
|
199
|
-
return self.parse_node(node).strip()
|
|
266
|
+
return self.parse_node(node).strip('\n')
|
|
200
267
|
|
|
201
268
|
def parse_remarks(self, node):
|
|
202
|
-
return '\n\n'+self.parse_node(node).strip()
|
|
269
|
+
return '\n\n'+self.parse_node(node).strip('\n')
|
|
203
270
|
|
|
204
271
|
def parse_param(self, node):
|
|
205
|
-
|
|
206
|
-
|
|
272
|
+
name = ':param %s: ' % self.language.parse_name(node.attrib['name'])
|
|
273
|
+
desc = self.parse_node(node, indent=len(name))[len(name):]
|
|
274
|
+
if len(desc) == 0:
|
|
275
|
+
return ''
|
|
276
|
+
return '\n\n' + name + desc
|
|
207
277
|
|
|
208
278
|
def parse_returns(self, node):
|
|
209
|
-
|
|
279
|
+
name = ':returns: '
|
|
280
|
+
desc = self.parse_node(node, indent=len(name))[len(name):]
|
|
281
|
+
if len(desc) == 0:
|
|
282
|
+
return ''
|
|
283
|
+
return '\n\n' + name + desc
|
|
210
284
|
|
|
211
285
|
def parse_see(self, node):
|
|
212
286
|
return self.parse_cref(node.attrib['cref'])
|
|
213
287
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return snake_case(node.attrib['name'])
|
|
288
|
+
def parse_paramref(self, node):
|
|
289
|
+
return self.language.parse_name(node.attrib['name'])
|
|
217
290
|
|
|
218
291
|
@staticmethod
|
|
219
292
|
def parse_a(node):
|
|
220
|
-
return
|
|
293
|
+
return "`%s <%s>`_" % \
|
|
294
|
+
(node.text.replace('\n', ' '), node.attrib['href'])
|
|
221
295
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
296
|
+
def parse_c(self, node):
|
|
297
|
+
code = node.text
|
|
298
|
+
code = self.language.value_map.get(code, code)
|
|
299
|
+
return '``%s``' % code
|
|
225
300
|
|
|
226
301
|
@staticmethod
|
|
227
302
|
def parse_math(node):
|
|
228
|
-
return node.text
|
|
303
|
+
return '``%s``' % node.text
|
|
229
304
|
|
|
230
305
|
def parse_list(self, node):
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
306
|
+
lines = [
|
|
307
|
+
' * ' + self.parse_node(item[0], indent=3)[3:].rstrip()
|
|
308
|
+
for item in node
|
|
309
|
+
]
|
|
310
|
+
content = '\n'.join(lines)
|
|
311
|
+
return content
|
|
234
312
|
|
|
235
313
|
@staticmethod
|
|
236
314
|
def parse_cref(cref):
|
|
315
|
+
# FIXME: is this correct?
|
|
237
316
|
if cref[0] == 'M':
|
|
238
317
|
cref = cref[2:].split('.')
|
|
239
318
|
member = lower_camel_case(cref[-1])
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# pylint: disable=line-too-long,invalid-name,redefined-builtin,too-many-lines
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Tuple, Set, Dict, List, Optional, TYPE_CHECKING
|
|
4
|
+
import krpc.schema
|
|
5
|
+
from krpc.schema import KRPC_pb2
|
|
6
|
+
from krpc.types import TypeBase, ClassBase, WrappedClass, DocEnum
|
|
7
|
+
from krpc.event import Event
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from krpc.services import Client
|
|
10
|
+
{% for service in dependencies %}
|
|
11
|
+
from krpc.services import {{service|lower()}}
|
|
12
|
+
{% endfor %}
|
|
13
|
+
|
|
14
|
+
{% macro arg_list(parameters) %}
|
|
15
|
+
self{% for x in parameters %}, {{x.name}}: {{ x.type.spec }}{%if 'default_value' in x %} = {{x.default_value}}{% endif %}{% endfor %}{% endmacro %}
|
|
16
|
+
{% macro static_arg_list(parameters) %}
|
|
17
|
+
{% for x in parameters %}{{x.name}}: {{ x.type.spec }}{%if 'default_value' in x %} = {{x.default_value}}{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% endmacro %}
|
|
18
|
+
{% macro arg_names(parameters) %}
|
|
19
|
+
{% for x in parameters %}"{{x.name}}"{% if not loop.last %}, {% endif %}{% endfor %}{% endmacro %}
|
|
20
|
+
{% macro arg_values(parameters) %}
|
|
21
|
+
{% for x in parameters %}{{x.name}}{% if not loop.last %}, {% endif %}{% endfor %}{% endmacro %}
|
|
22
|
+
{% macro arg_types(parameters) %}
|
|
23
|
+
{% for x in parameters %}{{x.type.python_type}}{% if not loop.last %}, {% endif %}{% endfor %}{% endmacro %}
|
|
24
|
+
|
|
25
|
+
{% for enum_name, enumeration in enumerations.items() %}
|
|
26
|
+
class {{enum_name}}(DocEnum):
|
|
27
|
+
{% if enumeration.documentation %}{{ enumeration.documentation | indent(width=4) }}
|
|
28
|
+
{% endif %}
|
|
29
|
+
{% for enum_value in enumeration['values'] %}
|
|
30
|
+
{{enum_value['name']}} = {{enum_value['value']}}{% if enum_value.documentation %}, {{ enum_value.documentation }}{% endif %}
|
|
31
|
+
|
|
32
|
+
{% endfor %}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
{% endfor %}
|
|
36
|
+
{% for exception_name, exception in exceptions.items() %}
|
|
37
|
+
class {{exception_name}}(RuntimeError):
|
|
38
|
+
{% if exception.documentation %}{{ exception.documentation | indent(width=4) }}
|
|
39
|
+
{% endif %}
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
{% endfor %}
|
|
44
|
+
{% for class_name, class in classes.items() %}
|
|
45
|
+
class {{class_name}}(ClassBase):
|
|
46
|
+
{% if class.documentation %}{{ class.documentation | indent(width=4) }}
|
|
47
|
+
{% endif %}
|
|
48
|
+
{% for prop_name, prop in class['properties'].items() %}
|
|
49
|
+
{% if 'getter' in prop %}
|
|
50
|
+
@property
|
|
51
|
+
def {{prop_name}}(self) -> {{ prop.getter.return_type.spec }}:
|
|
52
|
+
{% if prop.getter.documentation %}{{ prop.getter.documentation | indent(width=8) }}
|
|
53
|
+
{% endif %}
|
|
54
|
+
return self._client._invoke(
|
|
55
|
+
"{{ service_name }}",
|
|
56
|
+
"{{ prop.getter.remote_name }}",
|
|
57
|
+
[self],
|
|
58
|
+
["self"],
|
|
59
|
+
[self._client._types.class_type("{{ service_name }}", "{{ class_name }}")],
|
|
60
|
+
{{ prop.getter.return_type.python_type }}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
{% else %}
|
|
64
|
+
@property
|
|
65
|
+
def {{prop_name}}(self) -> {{ prop.setter.parameters[0].type.spec }}:
|
|
66
|
+
raise NotImplementedError
|
|
67
|
+
|
|
68
|
+
{% endif %}
|
|
69
|
+
{% if 'setter' in prop %}
|
|
70
|
+
@{{prop_name}}.setter
|
|
71
|
+
def {{prop_name}}({{ arg_list(prop.setter.parameters) }}) -> None:
|
|
72
|
+
return self._client._invoke(
|
|
73
|
+
"{{ service_name }}",
|
|
74
|
+
"{{ prop.setter.remote_name }}",
|
|
75
|
+
[self, {{ arg_values(prop.setter.parameters) }}],
|
|
76
|
+
["self", {{ arg_names(prop.setter.parameters) }}],
|
|
77
|
+
[self._client._types.class_type("{{ service_name }}", "{{ class_name }}"), {{ arg_types(prop.setter.parameters) }}],
|
|
78
|
+
None
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
{% endif %}
|
|
82
|
+
{% if 'getter' in prop %}
|
|
83
|
+
def _return_type_{{prop_name}}(self) -> TypeBase:
|
|
84
|
+
return {{ prop.getter.return_type.python_type }}
|
|
85
|
+
|
|
86
|
+
def _build_call_{{prop_name}}(self) -> KRPC_pb2.ProcedureCall:
|
|
87
|
+
return self._client._build_call(
|
|
88
|
+
"{{ service_name }}",
|
|
89
|
+
"{{ prop.getter.remote_name }}",
|
|
90
|
+
[self],
|
|
91
|
+
["self"],
|
|
92
|
+
[self._client._types.class_type("{{ service_name }}", "{{ class_name }}")],
|
|
93
|
+
{{ prop.getter.return_type.python_type }}
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
{% endif %}
|
|
97
|
+
{% endfor %}
|
|
98
|
+
{% for proc_name, procedure in class['methods'].items() %}
|
|
99
|
+
def {{proc_name}}({{ arg_list(procedure.parameters) }}) -> {{ procedure.return_type.spec }}:
|
|
100
|
+
{% if procedure.documentation %}{{ procedure.documentation | indent(width=8) }}
|
|
101
|
+
{% endif %}
|
|
102
|
+
return self._client._invoke(
|
|
103
|
+
"{{ service_name }}",
|
|
104
|
+
"{{ procedure.remote_name }}",
|
|
105
|
+
[self, {{ arg_values(procedure.parameters) }}],
|
|
106
|
+
["self", {{ arg_names(procedure.parameters) }}],
|
|
107
|
+
[self._client._types.class_type("{{ service_name }}", "{{ class_name }}"), {{ arg_types(procedure.parameters) }}],
|
|
108
|
+
{{ procedure.return_type.python_type }}
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
def _return_type_{{proc_name}}(self) -> TypeBase:
|
|
112
|
+
return {{ procedure.return_type.python_type }}
|
|
113
|
+
|
|
114
|
+
def _build_call_{{proc_name}}({{ arg_list(procedure.parameters) }}) -> KRPC_pb2.ProcedureCall:
|
|
115
|
+
return self._client._build_call(
|
|
116
|
+
"{{ service_name }}",
|
|
117
|
+
"{{ procedure.remote_name }}",
|
|
118
|
+
[self, {{ arg_values(procedure.parameters) }}],
|
|
119
|
+
["self", {{ arg_names(procedure.parameters) }}],
|
|
120
|
+
[self._client._types.class_type("{{ service_name }}", "{{ class_name }}"), {{ arg_types(procedure.parameters) }}],
|
|
121
|
+
{{ procedure.return_type.python_type }}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
{% endfor %}
|
|
125
|
+
{% for proc_name, procedure in class['static_methods'].items() %}
|
|
126
|
+
@classmethod
|
|
127
|
+
def {{proc_name}}(cls, {{ static_arg_list(procedure.parameters) }}) -> {{ procedure.return_type.spec }}:
|
|
128
|
+
{% if procedure.documentation %}{{ procedure.documentation | indent(width=8) }}
|
|
129
|
+
{% endif %}
|
|
130
|
+
self = cls
|
|
131
|
+
return cls._client._invoke(
|
|
132
|
+
"{{ service_name }}",
|
|
133
|
+
"{{ procedure.remote_name }}",
|
|
134
|
+
[{{ arg_values(procedure.parameters) }}],
|
|
135
|
+
[{{ arg_names(procedure.parameters) }}],
|
|
136
|
+
[{{ arg_types(procedure.parameters) }}],
|
|
137
|
+
{{ procedure.return_type.python_type }}
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def _return_type_{{proc_name}}(cls) -> TypeBase:
|
|
142
|
+
self = cls
|
|
143
|
+
return {{ procedure.return_type.python_type }}
|
|
144
|
+
|
|
145
|
+
@classmethod
|
|
146
|
+
def _build_call_{{proc_name}}(cls, {{ static_arg_list(procedure.parameters) }}) -> KRPC_pb2.ProcedureCall:
|
|
147
|
+
self = cls
|
|
148
|
+
return self._client._build_call(
|
|
149
|
+
"{{ service_name }}",
|
|
150
|
+
"{{ procedure.remote_name }}",
|
|
151
|
+
[{{ arg_values(procedure.parameters) }}],
|
|
152
|
+
[{{ arg_names(procedure.parameters) }}],
|
|
153
|
+
[{{ arg_types(procedure.parameters) }}],
|
|
154
|
+
{{ procedure.return_type.python_type }}
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
{% endfor %}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
{% endfor %}
|
|
161
|
+
class {{ service_name }}:
|
|
162
|
+
{% if service_documentation %}{{ service_documentation | indent(width=4) }}
|
|
163
|
+
{% endif %}
|
|
164
|
+
|
|
165
|
+
def __init__(self, client: Client) -> None:
|
|
166
|
+
self._client = client
|
|
167
|
+
|
|
168
|
+
def __getattribute__(self, name):
|
|
169
|
+
# Intercepts calls to obtain classes from the service,
|
|
170
|
+
# to inject the client instance so that it can be used
|
|
171
|
+
# for static method calls
|
|
172
|
+
classes = object.__getattribute__(self, "_classes")
|
|
173
|
+
if name in classes:
|
|
174
|
+
client = object.__getattribute__(self, "_client")
|
|
175
|
+
return WrappedClass(client, classes[name])
|
|
176
|
+
|
|
177
|
+
# Intercept calls to obtain enumeration types
|
|
178
|
+
enumerations = object.__getattribute__(self, "_enumerations")
|
|
179
|
+
if name in enumerations:
|
|
180
|
+
return enumerations[name]
|
|
181
|
+
|
|
182
|
+
# Intercept calls to obtain exception types
|
|
183
|
+
exceptions = object.__getattribute__(self, "_exceptions")
|
|
184
|
+
if name in exceptions:
|
|
185
|
+
return exceptions[name]
|
|
186
|
+
|
|
187
|
+
# Fall back to default behaviour
|
|
188
|
+
return object.__getattribute__(self, name)
|
|
189
|
+
|
|
190
|
+
def __dir__(self):
|
|
191
|
+
result = object.__dir__(self)
|
|
192
|
+
result.extend(object.__getattribute__(self, "_classes").keys())
|
|
193
|
+
result.extend(object.__getattribute__(self, "_enumerations").keys())
|
|
194
|
+
result.extend(object.__getattribute__(self, "_exceptions").keys())
|
|
195
|
+
return result
|
|
196
|
+
|
|
197
|
+
_classes = {
|
|
198
|
+
{% for class_name in classes.keys() %}
|
|
199
|
+
"{{class_name}}": {{ class_name }},
|
|
200
|
+
{% endfor %}
|
|
201
|
+
}
|
|
202
|
+
_enumerations = {
|
|
203
|
+
{% for enum_name in enumerations.keys() %}
|
|
204
|
+
"{{ enum_name }}": {{ enum_name }},
|
|
205
|
+
{% endfor %}
|
|
206
|
+
}
|
|
207
|
+
_exceptions = {
|
|
208
|
+
{% for exception_name in exceptions.keys() %}
|
|
209
|
+
"{{ exception_name }}": {{ exception_name }},
|
|
210
|
+
{% endfor %}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
{% for prop_name, prop in properties.items() %}
|
|
214
|
+
{% if 'getter' in prop %}
|
|
215
|
+
@property
|
|
216
|
+
def {{prop_name}}(self) -> {{ prop.getter.return_type.spec }}:
|
|
217
|
+
{% if prop.getter.documentation %}{{ prop.getter.documentation | indent(width=8) }}
|
|
218
|
+
{% endif %}
|
|
219
|
+
return self._client._invoke(
|
|
220
|
+
"{{ service_name }}",
|
|
221
|
+
"{{ prop.getter.remote_name }}",
|
|
222
|
+
[],
|
|
223
|
+
[],
|
|
224
|
+
[],
|
|
225
|
+
{{ prop.getter.return_type.python_type }}
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
{% else %}
|
|
229
|
+
@property
|
|
230
|
+
def {{prop_name}}(self) -> {{ prop.setter.parameters[0].type.spec }}:
|
|
231
|
+
raise NotImplementedError
|
|
232
|
+
|
|
233
|
+
{% endif %}
|
|
234
|
+
{% if 'setter' in prop %}
|
|
235
|
+
@{{prop_name}}.setter
|
|
236
|
+
def {{prop_name}}({{ arg_list(prop.setter.parameters) }}) -> None:
|
|
237
|
+
return self._client._invoke(
|
|
238
|
+
"{{ service_name }}",
|
|
239
|
+
"{{ prop.setter.remote_name }}",
|
|
240
|
+
[{{ arg_values(prop.setter.parameters) }}],
|
|
241
|
+
[{{ arg_names(prop.setter.parameters) }}],
|
|
242
|
+
[{{ arg_types(prop.setter.parameters) }}],
|
|
243
|
+
None
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
{% endif %}
|
|
247
|
+
{% if 'getter' in prop %}
|
|
248
|
+
def _return_type_{{prop_name}}(self) -> TypeBase:
|
|
249
|
+
return {{ prop.getter.return_type.python_type }}
|
|
250
|
+
|
|
251
|
+
def _build_call_{{prop_name}}(self) -> KRPC_pb2.ProcedureCall:
|
|
252
|
+
return self._client._build_call(
|
|
253
|
+
"{{ service_name }}",
|
|
254
|
+
"{{ prop.getter.remote_name }}",
|
|
255
|
+
[],
|
|
256
|
+
[],
|
|
257
|
+
[],
|
|
258
|
+
{{ prop.getter.return_type.python_type }}
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
{% endif %}
|
|
262
|
+
{% endfor %}
|
|
263
|
+
{% for proc_name, procedure in procedures.items() %}
|
|
264
|
+
def {{proc_name}}({{ arg_list(procedure.parameters) }}) -> {{ procedure.return_type.spec }}:
|
|
265
|
+
{% if procedure.documentation %}{{ procedure.documentation | indent(width=8) }}
|
|
266
|
+
{% endif %}
|
|
267
|
+
return self._client._invoke(
|
|
268
|
+
"{{ service_name }}",
|
|
269
|
+
"{{ procedure.remote_name }}",
|
|
270
|
+
[{{ arg_values(procedure.parameters) }}],
|
|
271
|
+
[{{ arg_names(procedure.parameters) }}],
|
|
272
|
+
[{{ arg_types(procedure.parameters) }}],
|
|
273
|
+
{{ procedure.return_type.python_type }}
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
def _return_type_{{proc_name}}(self) -> TypeBase:
|
|
277
|
+
return {{ procedure.return_type.python_type }}
|
|
278
|
+
|
|
279
|
+
def _build_call_{{proc_name}}({{ arg_list(procedure.parameters) }}) -> KRPC_pb2.ProcedureCall:
|
|
280
|
+
return self._client._build_call(
|
|
281
|
+
"{{ service_name }}",
|
|
282
|
+
"{{ procedure.remote_name }}",
|
|
283
|
+
[{{ arg_values(procedure.parameters) }}],
|
|
284
|
+
[{{ arg_names(procedure.parameters) }}],
|
|
285
|
+
[{{ arg_types(procedure.parameters) }}],
|
|
286
|
+
{{ procedure.return_type.python_type }}
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
{% endfor %}
|
|
@@ -41,9 +41,7 @@ Service {{ x.name }}
|
|
|
41
41
|
{{ parameters_description(x.parameters) }}
|
|
42
42
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
43
43
|
{% endif %}
|
|
44
|
-
{% if x.game_scenes != None %}
|
|
45
44
|
{{ game_scenes(x.game_scenes) }}
|
|
46
|
-
{% endif %}
|
|
47
45
|
|
|
48
46
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
49
47
|
|
|
@@ -64,9 +62,7 @@ Service {{ x.name }}
|
|
|
64
62
|
|
|
65
63
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
66
64
|
{% endif %}
|
|
67
|
-
{% if x.game_scenes != None %}
|
|
68
65
|
{{ game_scenes(x.game_scenes) }}
|
|
69
|
-
{% endif %}
|
|
70
66
|
|
|
71
67
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
72
68
|
|
|
@@ -83,9 +79,7 @@ Service {{ x.name }}
|
|
|
83
79
|
{{ parameters_description(x.parameters[1:]) }}
|
|
84
80
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
85
81
|
{% endif %}
|
|
86
|
-
{% if x.game_scenes != None %}
|
|
87
82
|
{{ game_scenes(x.game_scenes) }}
|
|
88
|
-
{% endif %}
|
|
89
83
|
|
|
90
84
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
91
85
|
|
|
@@ -102,9 +96,7 @@ Service {{ x.name }}
|
|
|
102
96
|
{{ parameters_description(x.parameters) }}
|
|
103
97
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
104
98
|
{% endif %}
|
|
105
|
-
{% if x.game_scenes != None %}
|
|
106
99
|
{{ game_scenes(x.game_scenes) }}
|
|
107
|
-
{% endif %}
|
|
108
100
|
|
|
109
101
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
110
102
|
|
|
@@ -169,5 +161,7 @@ krpc_connection_t connection{% if domain.return_type(return_type) != 'void' %},
|
|
|
169
161
|
{% endmacro %}
|
|
170
162
|
|
|
171
163
|
{% macro game_scenes(x) %}
|
|
164
|
+
{% if x != None and x != 'All' %}
|
|
172
165
|
:Game Scenes: {{ x }}
|
|
166
|
+
{% endif %}
|
|
173
167
|
{% endmacro %}
|
|
@@ -46,9 +46,7 @@
|
|
|
46
46
|
{{ parameters_description(x.parameters) }}
|
|
47
47
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
48
48
|
{% endif %}
|
|
49
|
-
{% if x.game_scenes != None %}
|
|
50
49
|
{{ game_scenes(x.game_scenes) }}
|
|
51
|
-
{% endif %}
|
|
52
50
|
|
|
53
51
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
54
52
|
|
|
@@ -69,9 +67,7 @@
|
|
|
69
67
|
|
|
70
68
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
71
69
|
{% endif %}
|
|
72
|
-
{% if x.game_scenes != None %}
|
|
73
70
|
{{ game_scenes(x.game_scenes) }}
|
|
74
|
-
{% endif %}
|
|
75
71
|
|
|
76
72
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
77
73
|
|
|
@@ -88,9 +84,7 @@
|
|
|
88
84
|
{{ parameters_description(x.parameters[1:]) }}
|
|
89
85
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
90
86
|
{% endif %}
|
|
91
|
-
{% if x.game_scenes != None %}
|
|
92
87
|
{{ game_scenes(x.game_scenes) }}
|
|
93
|
-
{% endif %}
|
|
94
88
|
|
|
95
89
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
96
90
|
|
|
@@ -107,9 +101,7 @@
|
|
|
107
101
|
{{ parameters_description(x.parameters) }}
|
|
108
102
|
{% if hasdoc(x.documentation, './returns') %}{{ returns(x.documentation) | indent }}
|
|
109
103
|
{% endif %}
|
|
110
|
-
{% if x.game_scenes != None %}
|
|
111
104
|
{{ game_scenes(x.game_scenes) }}
|
|
112
|
-
{% endif %}
|
|
113
105
|
|
|
114
106
|
{% if hasdoc(x.documentation, './remarks') %}{{ remarks(x.documentation) | indent }}
|
|
115
107
|
|
|
@@ -181,5 +173,7 @@
|
|
|
181
173
|
{% endmacro %}
|
|
182
174
|
|
|
183
175
|
{% macro game_scenes(x) %}
|
|
176
|
+
{% if x != None and x != 'All' %}
|
|
184
177
|
:Game Scenes: {{ x }}
|
|
178
|
+
{% endif %}
|
|
185
179
|
{% endmacro %}
|