@@ -91,8 +91,8 @@ def add_construct(self, pspec, argument_class,
91
91
self .required_output = []
92
92
self .optional_output = []
93
93
94
- # same, but with deprecated and redundant args filtered out ... this is
95
- # the set we show in documentation
94
+ # same, but with deprecated args filtered out ... this is the set we
95
+ # show in documentation
96
96
self .doc_optional_input = []
97
97
self .doc_optional_output = []
98
98
@@ -117,12 +117,7 @@ def add_construct(self, pspec, argument_class,
117
117
(flags & _REQUIRED ) == 0 ):
118
118
self .optional_input .append (name )
119
119
120
- # drop "revalidate" flag from buffer loaders and operations
121
- # marked "nocache" as they are already uncached
122
- if ((flags & _DEPRECATED ) == 0 and
123
- (name != 'revalidate' or
124
- ('_buffer' not in operation_name and
125
- (self .flags & _OPERATION_NOCACHE ) == 0 ))):
120
+ if (flags & _DEPRECATED ) == 0 :
126
121
self .doc_optional_input .append (name )
127
122
128
123
if ((flags & _OUTPUT ) != 0 and
@@ -423,14 +418,21 @@ def generate_sphinx(operation_name):
423
418
raise Error ('No such operator.' ,
424
419
f'operator "{ operation_name } " is deprecated' )
425
420
421
+ # drop "revalidate" flag from buffer loaders and operations marked
422
+ # "nocache" as they are already uncached
423
+ doc_optional_input = [name for name in intro .doc_optional_input if
424
+ name != 'revalidate' or
425
+ ('_buffer' not in operation_name and
426
+ (intro .flags & _OPERATION_NOCACHE ) == 0 )]
427
+
426
428
if intro .member_x is not None :
427
429
result = '.. method:: '
428
430
else :
429
431
result = '.. staticmethod:: '
430
432
args = []
431
433
args += intro .method_args
432
434
args += [x + '=' + GValue .gtype_to_python (intro .details [x ]['type' ])
433
- for x in intro . doc_optional_input ]
435
+ for x in doc_optional_input ]
434
436
args += [x + '=bool'
435
437
for x in intro .doc_optional_output ]
436
438
result += operation_name + '(' + ", " .join (args ) + ')\n \n '
@@ -449,11 +451,11 @@ def generate_sphinx(operation_name):
449
451
args = []
450
452
args += intro .method_args
451
453
args += [x + '=' + GValue .gtype_to_python (intro .details [x ]['type' ])
452
- for x in intro . doc_optional_input ]
454
+ for x in doc_optional_input ]
453
455
result += ', ' .join (args )
454
456
result += ')\n \n '
455
457
456
- for name in intro .method_args + intro . doc_optional_input :
458
+ for name in intro .method_args + doc_optional_input :
457
459
details = intro .details [name ]
458
460
result += f':param { name } : { details ["blurb" ]} \n '
459
461
result += (f':type { name } : '
0 commit comments