fix: gradingreponame schema
This commit is contained in:
parent
12451eebbe
commit
922f79071e
|
@ -1,5 +1,5 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import socket
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
@ -24,13 +24,8 @@ def get_temp_directory() -> str:
|
||||||
|
|
||||||
|
|
||||||
def getGradingRepoName() -> str:
|
def getGradingRepoName() -> str:
|
||||||
path = os.path.expanduser("~/.config/teapot/teapot.env")
|
host_name = socket.gethostname()
|
||||||
if os.path.exists(path):
|
return f"{host_name.split('-')[0]}-joj"
|
||||||
load_dotenv(path)
|
|
||||||
repo_name = os.environ.get("GITEA_ORG_NAME")
|
|
||||||
if repo_name is not None:
|
|
||||||
return f"{repo_name.split('-')[0]}-joj"
|
|
||||||
return "ece482-joj"
|
|
||||||
|
|
||||||
|
|
||||||
def getTeapotConfig(repo_conf: Repo, task_conf: Task) -> TeapotConfig:
|
def getTeapotConfig(repo_conf: Repo, task_conf: Task) -> TeapotConfig:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user