@@ -107,11 +107,13 @@ def __init__(
107
107
)
108
108
wildcard_prefixes = repr (parse_wildcards (props ))
109
109
list_of_valid_keys = repr (list (map (str , filtered_props .keys ())))
110
+ custom_ignore = get_custom_ignore (custom_typing_module )
110
111
docstring = create_docstring (
111
112
component_name = typename ,
112
113
props = filtered_props ,
113
114
description = description ,
114
115
prop_reorder_exceptions = prop_reorder_exceptions ,
116
+ ignored_props = custom_ignore ,
115
117
).replace ("\r \n " , "\n " )
116
118
required_args = required_props (filtered_props )
117
119
is_children_required = "children" in required_args
@@ -151,8 +153,6 @@ def __init__(
151
153
152
154
default_arglist = []
153
155
154
- custom_ignore = get_custom_ignore (custom_typing_module )
155
-
156
156
for prop_key in prop_keys :
157
157
prop = props [prop_key ]
158
158
if (
@@ -340,7 +340,13 @@ def required_props(props):
340
340
return [prop_name for prop_name , prop in list (props .items ()) if prop ["required" ]]
341
341
342
342
343
- def create_docstring (component_name , props , description , prop_reorder_exceptions = None ):
343
+ def create_docstring (
344
+ component_name ,
345
+ props ,
346
+ description ,
347
+ prop_reorder_exceptions = None ,
348
+ ignored_props = tuple (),
349
+ ):
344
350
"""Create the Dash component docstring.
345
351
Parameters
346
352
----------
@@ -377,7 +383,7 @@ def create_docstring(component_name, props, description, prop_reorder_exceptions
377
383
indent_num = 0 ,
378
384
is_flow_type = "flowType" in prop and "type" not in prop ,
379
385
)
380
- for p , prop in filter_props (props ).items ()
386
+ for p , prop in filter_props (props , ignored_props ).items ()
381
387
)
382
388
383
389
return (
@@ -442,7 +448,7 @@ def reorder_props(props):
442
448
return OrderedDict (props1 + props2 + sorted (list (props .items ())))
443
449
444
450
445
- def filter_props (props ):
451
+ def filter_props (props , ignored_props = tuple () ):
446
452
"""Filter props from the Component arguments to exclude:
447
453
- Those without a "type" or a "flowType" field
448
454
- Those with arg.type.name in {'func', 'symbol', 'instanceOf'}
@@ -487,7 +493,7 @@ def filter_props(props):
487
493
filtered_props = copy .deepcopy (props )
488
494
489
495
for arg_name , arg in list (filtered_props .items ()):
490
- if "type" not in arg and "flowType" not in arg :
496
+ if arg_name in ignored_props or ( "type" not in arg and "flowType" not in arg ) :
491
497
filtered_props .pop (arg_name )
492
498
continue
493
499
0 commit comments