prj/str
Some checks failed
/ job (push) Failing after 14m50s

This commit is contained in:
Marc Beninca 2024-06-10 21:10:51 +02:00
parent 0d4c6460e7
commit 033898ccc0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 17 additions and 0 deletions

View file

@ -12,7 +12,9 @@ from cd.projects import Projects
COMMANDS_PREFIX = "cd-"
projects = Projects()
print(projects)
project = Project(projects)
print(project)
def cd_browse_workspace() -> None:

View file

@ -40,3 +40,11 @@ class Project:
self.root = value
# url
self.url = urljoin(projects.url, self.name)
def __str__(self: Project) -> str:
return """\
branch = {self.branch}
name = {self.name}
root = {self.root}
url = {self.url}
"""

View file

@ -29,3 +29,10 @@ class Projects:
for variable in SERVER_URL:
if value := self.environment.get(variable, None):
self.url = urljoin(value, self.group)
def __str__(self: Projects) -> str:
return """\
group = {self.group}
name = {self.name}
url = {self.url}
"""