@@ -30,29 +30,37 @@ def _process_docstring(app, what, name, obj, options, lines):
30
30
class GitlabDocstring (GoogleDocstring ):
31
31
def _build_doc (self ):
32
32
cls = self ._obj .obj_cls
33
+ opt_get_list = cls .optionalGetAttrs
34
+ opt_list_list = cls .optionalListAttrs
33
35
md_create_list = list (itertools .chain (cls .requiredUrlAttrs ,
34
36
cls .requiredCreateAttrs ))
35
37
opt_create_list = cls .optionalCreateAttrs
36
38
39
+ opt_get_keys = "None"
40
+ if opt_get_list :
41
+ opt_get_keys = ", " .join (['``%s``' % i for i in opt_get_list ])
42
+
43
+ opt_list_keys = "None"
44
+ if opt_list_list :
45
+ opt_list_keys = ", " .join (['``%s``' % i for i in opt_list_list ])
46
+
37
47
md_create_keys = opt_create_keys = "None"
38
48
if md_create_list :
39
- md_create_keys = "%s" % ", " .join (['``%s``' % i for i in
40
- md_create_list ])
49
+ md_create_keys = ", " .join (['``%s``' % i for i in md_create_list ])
41
50
if opt_create_list :
42
- opt_create_keys = "%s" % " , " .join (['``%s``' % i for i in
43
- opt_create_list ])
51
+ opt_create_keys = ", " .join (['``%s``' % i for i in
52
+ opt_create_list ])
44
53
45
54
md_update_list = list (itertools .chain (cls .requiredUrlAttrs ,
46
55
cls .requiredUpdateAttrs ))
47
56
opt_update_list = cls .optionalUpdateAttrs
48
57
49
58
md_update_keys = opt_update_keys = "None"
50
59
if md_update_list :
51
- md_update_keys = "%s" % ", " .join (['``%s``' % i for i in
52
- md_update_list ])
60
+ md_update_keys = ", " .join (['``%s``' % i for i in md_update_list ])
53
61
if opt_update_list :
54
- opt_update_keys = "%s" % " , " .join (['``%s``' % i for i in
55
- opt_update_list ])
62
+ opt_update_keys = ", " .join (['``%s``' % i for i in
63
+ opt_update_list ])
56
64
57
65
tmpl_file = os .path .join (os .path .dirname (__file__ ), 'template.j2' )
58
66
with open (tmpl_file ) as fd :
@@ -62,7 +70,9 @@ def _build_doc(self):
62
70
md_create_keys = md_create_keys ,
63
71
opt_create_keys = opt_create_keys ,
64
72
md_update_keys = md_update_keys ,
65
- opt_update_keys = opt_update_keys )
73
+ opt_update_keys = opt_update_keys ,
74
+ opt_get_keys = opt_get_keys ,
75
+ opt_list_keys = opt_list_keys )
66
76
67
77
return output .split ('\n ' )
68
78
0 commit comments