File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -488,21 +488,22 @@ def __str__(self):
488
488
489
489
def pretty_print (self , depth = 0 ):
490
490
id = self .__dict__ [self .idAttr ]
491
- print ("%sid : %s" % (" " * depth * 2 , id ))
491
+ print ("%s%s : %s" % (" " * depth * 2 , self . idAttr , id ))
492
492
for k in sorted (self .__dict__ .keys ()):
493
- if k == "id" :
493
+ if k == self . idAttr :
494
494
continue
495
495
v = self .__dict__ [k ]
496
+ pretty_k = k .replace ('_' , '-' )
496
497
if isinstance (v , GitlabObject ):
497
498
if depth == 0 :
498
- print ("%s:" % k )
499
+ print ("%s:" % pretty_k )
499
500
v .pretty_print (1 )
500
501
else :
501
- print ("%s: %s" % (k , v .id ))
502
+ print ("%s: %s" % (pretty_k , v .id ))
502
503
else :
503
504
if isinstance (v , Gitlab ):
504
505
continue
505
- print ("%s%s: %s" % (" " * depth * 2 , k , v ))
506
+ print ("%s%s: %s" % (" " * depth * 2 , pretty_k , v ))
506
507
507
508
def json (self ):
508
509
return json .dumps (self .__dict__ , cls = jsonEncoder )
You can’t perform that action at this time.
0 commit comments