@@ -26,6 +26,13 @@ class PropertyInfo:
26
26
setter : str
27
27
index : Optional [int ]
28
28
29
+ # If using feature we don't support yet
30
+ unsupported_reason : Optional [str ] = None
31
+
32
+ @property
33
+ def is_supported (self ) -> bool :
34
+ return self .unsupported_reason is None
35
+
29
36
30
37
@dataclass
31
38
class ArgumentInfo :
@@ -43,6 +50,13 @@ class SignalInfo:
43
50
name : str
44
51
arguments : List [ArgumentInfo ]
45
52
53
+ # If using feature we don't support yet
54
+ unsupported_reason : Optional [str ] = None
55
+
56
+ @property
57
+ def is_supported (self ) -> bool :
58
+ return self .unsupported_reason is None
59
+
46
60
47
61
@dataclass
48
62
class MethodInfo :
@@ -57,6 +71,13 @@ class MethodInfo:
57
71
is_from_script : bool
58
72
arguments : List [ArgumentInfo ]
59
73
74
+ # If using feature we don't support yet
75
+ unsupported_reason : Optional [str ] = None
76
+
77
+ @property
78
+ def is_supported (self ) -> bool :
79
+ return self .unsupported_reason is None
80
+
60
81
61
82
@dataclass
62
83
class EnumInfo :
@@ -240,66 +261,43 @@ def _is_supported_type(specs):
240
261
else :
241
262
return True
242
263
243
- kept_classes = []
244
264
for klass in classes :
245
- methods = []
246
265
for meth in klass .methods :
266
+ unsupported_reason = None
247
267
# TODO: handle default param values
248
268
# TODO: handle those flags
249
269
if meth .is_editor :
250
- # warn(f"Ignoring `{klass.name}.{meth.name}` (attribute `is_editor=True` not supported)")
251
- continue
270
+ unsupported_reason = "attribute `is_editor=True` not supported"
252
271
if meth .is_reverse :
253
- warn (
254
- f"Ignoring `{ klass .name } .{ meth .name } ` (attribute `is_reverse=True` not supported)"
255
- )
256
- continue
257
- if meth .is_virtual :
258
- # warn(f"Ignoring `{klass.name}.{meth.name}` (attribute `is_virtual=True` not supported)")
259
- continue
272
+ unsupported_reason = "attribute `is_reverse=True` not supported"
260
273
if meth .has_varargs :
261
- # warn(f"Ignoring `{klass.name}.{meth.name}` (attribute `has_varargs=True` not supported)")
262
- continue
274
+ unsupported_reason = "attribute `has_varargs=True` not supported"
263
275
if not _is_supported_type (meth .return_type ):
264
- warn (
265
- f"Ignoring `{ klass .name } .{ meth .name } ` (return type { meth .return_type } not supported)"
266
- )
267
- continue
276
+ unsupported_reason = f"return type { meth .return_type } not supported"
268
277
bad_arg = next (
269
278
(arg for arg in meth .arguments if not _is_supported_type (arg .type )), None
270
279
)
271
280
if bad_arg :
272
- warn (f"Ignoring `{ klass .name } .{ meth .name } ` (argument type { bad_arg } not supported)" )
273
- continue
274
- methods .append (meth )
275
- klass .methods = methods
281
+ unsupported_reason = f"argument type { bad_arg } not supported"
282
+
283
+ if unsupported_reason :
284
+ warn (f"Ignoring `{ klass .name } .{ meth .name } ` ({ unsupported_reason } )" )
285
+ meth .unsupported_reason = unsupported_reason
276
286
277
- properties = []
278
287
for prop in klass .properties :
279
288
if not _is_supported_type (prop .type ):
280
- warn (
281
- f"Ignoring property `{ klass .name } .{ prop .name } ` (property type { prop .type } not supported)"
282
- )
283
- continue
284
- properties .append (prop )
285
- klass .properties = properties
289
+ unsupported_reason = f"property type { prop .type } not supported"
290
+ warn (f"Ignoring property `{ klass .name } .{ prop .name } ` ({ unsupported_reason } )" )
291
+ prop .unsupported_reason = unsupported_reason
286
292
287
- signals = []
288
293
for signal in klass .signals :
289
294
bad_arg = next (
290
295
(arg for arg in signal .arguments if not _is_supported_type (arg .type )), None
291
296
)
292
297
if bad_arg :
293
- warn (
294
- f"Ignoring signal `{ klass .name } .{ signal .name } ` (argument type { bad_arg } not supported)"
295
- )
296
- continue
297
- signals .append (signal )
298
- klass .signals = signals
299
-
300
- kept_classes .append (klass )
301
-
302
- return kept_classes
298
+ unsupported_reason = f"argument type { bad_arg } not supported"
299
+ warn (f"Ignoring signal `{ klass .name } .{ signal .name } ` ({ unsupported_reason } )" )
300
+ signal .unsupported_reason = unsupported_reason
303
301
304
302
305
303
def strip_sample_stuff (classes ):
0 commit comments