diff --git a/judge/management/commands/submit_polygon_solutions.py b/judge/management/commands/submit_polygon_solutions.py index 71638f29f..0d67d49b9 100644 --- a/judge/management/commands/submit_polygon_solutions.py +++ b/judge/management/commands/submit_polygon_solutions.py @@ -48,38 +48,19 @@ def handle(self, *args, **options): if source_lang.startswith('cpp'): header = '/*\n' + '\n'.join(comments) + '\n*/\n\n' source_code = header + package.read(source_path).decode('utf-8') - language = Language.objects.get(key='CPP20') + language = Language.objects.get(key='CPPICPC') elif source_lang.startswith('java'): header = '/*\n' + '\n'.join(comments) + '\n*/\n\n' source_code = header + package.read(source_path).decode('utf-8') language = Language.objects.get(key='JAVA') - elif source_lang.startswith('pas'): - header = '{\n' + '\n'.join(comments) + '\n}\n\n' - source_code = header + package.read(source_path).decode('utf-8') - language = Language.objects.get(key='PAS') - elif source_lang.startswith('python'): + elif source_lang.startswith('python.pypy3') or source_lang == 'python.3': header = '"""\n' + '\n'.join(comments) + '\n"""\n\n' source_code = header + package.read(source_path).decode('utf-8') - if source_lang == 'python.pypy2': - language = Language.objects.get(key='PYPY') - elif source_lang.startswith('python.pypy3'): - language = Language.objects.get(key='PYPY3') - elif source_lang == 'python.2': - language = Language.objects.get(key='PY2') - else: - language = Language.objects.get(key='PY3') + language = Language.objects.get(key='PYPY3') elif source_lang.startswith('kotlin'): header = '/*\n' + '\n'.join(comments) + '\n*/\n\n' source_code = header + package.read(source_path).decode('utf-8') language = Language.objects.get(key='KOTLIN') - elif source_lang == 'go': - header = '/*\n' + '\n'.join(comments) + '\n*/\n\n' - source_code = header + package.read(source_path).decode('utf-8') - language = Language.objects.get(key='GO') - elif source_lang == 'rust': - header = '/*\n' + '\n'.join(comments) + '\n*/\n\n' - source_code = header + package.read(source_path).decode('utf-8') - language = Language.objects.get(key='RUST') else: print('Unsupported language', source_lang) continue