project,projects

This commit is contained in:
Marc Beninca 2024-07-14 20:02:56 +02:00
parent 77e9dc6601
commit 685d3a31e0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,8 @@ from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.parse import urljoin
from spcd.util import add_url_path
if TYPE_CHECKING:
from spcd.projects import Projects
@ -39,7 +40,7 @@ class Project:
if value := projects.environment.get(variable, None):
self.root = value
# url
self.url = urljoin(projects.url, self.name)
self.url = add_url_path(projects.url, self.name)
def __str__(self: Project) -> str:
return f"""\

View file

@ -4,7 +4,8 @@ from __future__ import annotations
import os
from pathlib import Path
from urllib.parse import urljoin
from spcd.util import add_url_path
GROUP_AND_NAME = [
"GITHUB_REPOSITORY",
@ -28,7 +29,7 @@ class Projects:
# url
for variable in SERVER_URL:
if value := self.environment.get(variable, None):
self.url = urljoin(value, self.group)
self.url = add_url_path(value, self.group)
def __str__(self: Projects) -> str:
return f"""\