Commit 46d0c3a5 authored by wanli's avatar wanli

update

parent abb22f2a
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-29 20:21:46
LastEditTime: 2021-07-01 11:39:27
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\controller\api_manager.py
......@@ -17,6 +17,7 @@ from pony.orm import *
from app.setting import config
from model.user import User
from utils import md5_salt
from utils.ccode import convert_string
logger = logging.getLogger(__name__)
......@@ -51,27 +52,27 @@ class ApiManager(object):
return True, "success"
def get_escape_text(self, data):
fname = "./a.c"
target = os.sep.join(["out", fname])
# fname = "./a.c"
# target = os.sep.join(["out", fname])
if os.path.exists(fname):
os.remove(fname)
# if os.path.exists(fname):
# os.remove(fname)
if os.path.exists(target):
os.remove(target)
# if os.path.exists(target):
# os.remove(target)
with open(fname, "w+") as f:
f.write(data['string'])
# with open(fname, "w+") as f:
# f.write(data['string'])
result = os.system("./opqcp {i} ./out".format(i=fname))
print(result)
# result = os.system("./opqcp {i} ./out".format(i=fname))
# print(result)
with open(target) as f:
result = f.read()
# with open(target) as f:
# result = f.read()
return result
# return result
# return convert_string(data['string'])
return convert_string(data['string'])
def opqcp(self, params):
target_file = os.path.normpath(os.sep.join([config.get("UPLOAD_PATH"), params.get("filename")]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment