-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.py
36 lines (28 loc) · 842 Bytes
/
runner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from abc import ABC, abstractmethod
from helpers.commons import file_extension
class Runner(ABC):
def is_source_code(self, source_path: str) -> bool:
source_extension = file_extension(source_path)
return any(source_extension == extension for extension in self.file_extensions)
@property
@abstractmethod
def language_name(self) -> str:
pass
@property
@abstractmethod
def file_extensions(self) -> list[str]:
pass
@property
@abstractmethod
def help(self) -> str:
pass
@property
@abstractmethod
def container_name(self) -> str:
pass
@abstractmethod
def compilation_command(self, source_path: str, executable: str) -> str:
pass
@abstractmethod
def execution_command(self, executable_path: str) -> str:
pass