mirror of
https://github.com/RGBCube/CSAssignments
synced 2025-07-25 04:57:43 +00:00
Reformat
This commit is contained in:
parent
9ed2410cc0
commit
d782a4d879
4 changed files with 43 additions and 34 deletions
|
@ -21,4 +21,3 @@ for l in s.languages.values():
|
|||
except Exception as e:
|
||||
print("errrun", e)
|
||||
print()
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
|||
__all__ = ("Assignment",)
|
||||
|
||||
from functools import cached_property
|
||||
from typing import TypedDict, TYPE_CHECKING
|
||||
from tomllib import loads as decode_toml
|
||||
from os import system as cmd
|
||||
from tomllib import loads as decode_toml
|
||||
from typing import TYPE_CHECKING, TypedDict
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .language import Language
|
||||
|
@ -21,6 +21,7 @@ AssignmentConfig = TypedDict(
|
|||
}
|
||||
)
|
||||
|
||||
|
||||
class Assignment:
|
||||
__config: AssignmentConfig
|
||||
language: Language
|
||||
|
@ -68,7 +69,8 @@ class Assignment:
|
|||
if not self.language.is_compiled:
|
||||
return None
|
||||
|
||||
return cmd(self.language._build_command.format(
|
||||
return cmd(
|
||||
self.language._build_command.format(
|
||||
**{
|
||||
"out-file": self.__directory / "compiled.out",
|
||||
"main-file": self.__main_file.absolute(),
|
||||
|
@ -81,5 +83,9 @@ class Assignment:
|
|||
if self.language.is_compiled and not (self.__directory / "compiled.out").exists():
|
||||
self.compile(quiet=True)
|
||||
|
||||
return cmd(self.language._run_command.format((self.__directory / "compiled.out").absolute() if self.language.is_compiled else self.__main_file.absolute()))
|
||||
|
||||
return cmd(
|
||||
self.language._run_command.format(
|
||||
(
|
||||
self.__directory / "compiled.out").absolute() if self.language.is_compiled else self.__main_file.absolute()
|
||||
)
|
||||
)
|
||||
|
|
|
@ -2,14 +2,15 @@ from __future__ import annotations
|
|||
|
||||
__all__ = ("Language",)
|
||||
|
||||
from .assignment import Assignment
|
||||
from .consts import OS_KEY, CHECK_COMMAND_EXISTS
|
||||
from typing import TYPE_CHECKING, TypedDict
|
||||
from tomllib import loads as decode_toml
|
||||
from chalky import hex
|
||||
from functools import cached_property
|
||||
from os import system as cmd
|
||||
from chalky.shortcuts.sty import bold
|
||||
from tomllib import loads as decode_toml
|
||||
from typing import TYPE_CHECKING, TypedDict
|
||||
|
||||
from chalky import hex
|
||||
|
||||
from .assignment import Assignment
|
||||
from .consts import CHECK_COMMAND_EXISTS, OS_KEY
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
@ -53,6 +54,7 @@ LanguageConfig = TypedDict(
|
|||
}
|
||||
)
|
||||
|
||||
|
||||
class Language:
|
||||
__directory: Path
|
||||
__config: LanguageConfig
|
||||
|
|
|
@ -2,14 +2,16 @@ from __future__ import annotations
|
|||
|
||||
__all__ = ("Sources",)
|
||||
|
||||
from .language import Language
|
||||
from .consts import ROOT
|
||||
from functools import cached_property
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .consts import ROOT
|
||||
from .language import Language
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class Sources:
|
||||
__directory: Path
|
||||
languages: dict[str, Language]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue