Skip to content

Commit 82c9a07

Browse files
authored
Merge pull request #1996 from Psycojoker/project-name-in-repr
feat(ux): display project.name_with_namespace on project repr
2 parents 3e0d4d9 + e598762 commit 82c9a07

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gitlab/v4/objects/projects.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO
186186
variables: ProjectVariableManager
187187
wikis: ProjectWikiManager
188188

189+
def __repr__(self) -> str:
190+
project_repr = super().__repr__()
191+
192+
if hasattr(self, "name_with_namespace"):
193+
return (
194+
f'{project_repr[:-1]} name_with_namespace:"{self.name_with_namespace}">'
195+
)
196+
else:
197+
return project_repr
198+
189199
@cli.register_custom_action("Project", ("forked_from_id",))
190200
@exc.on_http_error(exc.GitlabCreateError)
191201
def create_fork_relation(self, forked_from_id: int, **kwargs: Any) -> None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy