project,projects
This commit is contained in:
parent
77e9dc6601
commit
685d3a31e0
2 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
from urllib.parse import urljoin
|
|
||||||
|
from spcd.util import add_url_path
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from spcd.projects import Projects
|
from spcd.projects import Projects
|
||||||
|
@ -39,7 +40,7 @@ class Project:
|
||||||
if value := projects.environment.get(variable, None):
|
if value := projects.environment.get(variable, None):
|
||||||
self.root = value
|
self.root = value
|
||||||
# url
|
# url
|
||||||
self.url = urljoin(projects.url, self.name)
|
self.url = add_url_path(projects.url, self.name)
|
||||||
|
|
||||||
def __str__(self: Project) -> str:
|
def __str__(self: Project) -> str:
|
||||||
return f"""\
|
return f"""\
|
||||||
|
|
|
@ -4,7 +4,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib.parse import urljoin
|
|
||||||
|
from spcd.util import add_url_path
|
||||||
|
|
||||||
GROUP_AND_NAME = [
|
GROUP_AND_NAME = [
|
||||||
"GITHUB_REPOSITORY",
|
"GITHUB_REPOSITORY",
|
||||||
|
@ -28,7 +29,7 @@ class Projects:
|
||||||
# url
|
# url
|
||||||
for variable in SERVER_URL:
|
for variable in SERVER_URL:
|
||||||
if value := self.environment.get(variable, None):
|
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:
|
def __str__(self: Projects) -> str:
|
||||||
return f"""\
|
return f"""\
|
||||||
|
|
Loading…
Reference in a new issue