修改部分常量定义

增加编译功能
This commit is contained in:
virusdefender
2015-07-07 13:33:38 +08:00
parent cc0f720de9
commit ef88a8a155
5 changed files with 84 additions and 37 deletions

View File

@@ -1 +1,14 @@
# coding=utf-8
import commands
class CompileError(Exception):
pass
def compile_(language_item, src_path, exe_path):
command = language_item["compile_command"].format(src_path=src_path, exe_path=exe_path)
status, output = commands.getstatusoutput(command)
if status:
raise CompileError(output)
return exe_path