| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5a20efb commit 7175772
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -396,6 +396,7 @@ class GitlabObject(object): | |||
| 396 | 396 | requiredGetAttrs = [] | |
| 397 | 397 | requiredCreateAttrs = [] | |
| 398 | 398 | optionalCreateAttrs = [] | |
| 399 | + idAttr = 'id' | ||
| 399 | 400 | ||
| 400 | 401 | @classmethod | |
| 401 | 402 | def list(cls, gl, **kwargs): | |
@@ -486,7 +487,8 @@ def __str__(self): | |||
| 486 | 487 | return '%s => %s' % (type(self), str(self.__dict__)) | |
| 487 | 488 | ||
| 488 | 489 | def pretty_print(self, depth=0): | |
| 489 | - print("%sid: %s" % (" " * depth * 2, self.id)) | ||
| 490 | + id = self.__dict__[self.idAttr] | ||
| 491 | + print("%sid: %s" % (" " * depth * 2, id)) | ||
| 490 | 492 | for k in sorted(self.__dict__.keys()): | |
| 491 | 493 | if k == "id": | |
| 492 | 494 | continue | |
@@ -562,6 +564,7 @@ class Issue(GitlabObject): | |||
| 562 | 564 | ||
| 563 | 565 | class ProjectBranch(GitlabObject): | |
| 564 | 566 | _url = '/projects/%(project_id)s/repository/branches' | |
| 567 | + idAttr = 'name' | ||
| 565 | 568 | canDelete = False | |
| 566 | 569 | canUpdate = False | |
| 567 | 570 | canCreate = False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments