File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,17 @@ def short_print(self, depth=0):
504
504
self .shortPrintAttr .replace ('_' , '-' ),
505
505
self .__dict__ [self .shortPrintAttr ]))
506
506
507
+ @staticmethod
508
+ def _obj_to_str (obj ):
509
+ if isinstance (obj , dict ):
510
+ s = ", " .join (["%s: %s" % (x , GitlabObject ._obj_to_str (y )) for (x , y ) in obj .items ()])
511
+ return "{ %s }" % s
512
+ elif isinstance (obj , list ):
513
+ s = ", " .join ([GitlabObject ._obj_to_str (x ) for x in obj ])
514
+ return "[ %s ]" % s
515
+ else :
516
+ return str (obj )
517
+
507
518
def pretty_print (self , depth = 0 ):
508
519
id = self .__dict__ [self .idAttr ]
509
520
print ("%s%s: %s" % (" " * depth * 2 , self .idAttr , id ))
@@ -521,6 +532,7 @@ def pretty_print(self, depth=0):
521
532
else :
522
533
if isinstance (v , Gitlab ):
523
534
continue
535
+ v = GitlabObject ._obj_to_str (v )
524
536
print ("%s%s: %s" % (" " * depth * 2 , pretty_k , v ))
525
537
526
538
def json (self ):
You can’t perform that action at this time.
0 commit comments