实现在动态获取语言编译命令

This commit is contained in:
Harry-zklcdc 2019-10-01 15:59:28 +08:00
parent b9cf57947b
commit cc43dc7e90

View File

@ -10,7 +10,6 @@ from conf.models import JudgeServer
from options.options import SysOptions
from utils.cache import cache
from utils.constants import CacheKey
from judge.languages import _c_lang_config, _c_o2_lang_config, _cpp_lang_config, _cpp_o2_lang_config, _java_lang_config, _py2_lang_config, _py3_lang_config
logger = logging.getLogger(__name__)
@ -61,23 +60,6 @@ class IDEDispatcher(object):
def judge(self):
if not self.test_case:
raise ValueError("invalid parameter")
'''
if self.language == "C":
language_config = _c_lang_config
if self.language == "C With O2":
language_config = _c_o2_lang_config
if self.language == "C++":
language_config = _cpp_lang_config
if self.language == "C++ With O2":
language_config = _cpp_o2_lang_config
if self.language == "Java":
language_config = _java_lang_config
if self.language == "Python2":
language_config = _py2_lang_config
if self.language == "Python3":
language_config = _py3_lang_config
'''
sub_config = list(filter(lambda item: self.language == item["name"], SysOptions.languages))[0]