Commit 3fea3144 authored by wanliofficial's avatar wanliofficial

update

parent dadb89fb
......@@ -37,6 +37,8 @@ logs/*.log.*
frontend/node_modules
frontend/dist
backend/*.c
backend/out
backend/logs/*.log
backend/logs/*.log.*
backend/nohup.out
......
{"lastModifyDateTime": 1622539747}
\ No newline at end of file
{"lastModifyDateTime": 1624346271}
\ No newline at end of file
......@@ -21,4 +21,4 @@ backup_dir = backup
evueapps_dir = evueapps
launcher_dir = launcher
host = 127.0.0.1
port = 5001
\ No newline at end of file
port = 5000
\ No newline at end of file
......@@ -24,6 +24,7 @@ def initConnect():
signalManager.actionApplicationBuild.connect(appsManager.build)
signalManager.actionGetConvertString.connect(apiManager.get_escape_text)
signalManager.actionUpdatePassword.connect(apiManager.update_user_password)
signalManager.actionOpqcp.connect(apiManager.opqcp)
# 登录模块
signalManager.actionLogin.connect(loginManager.login)
......
......@@ -15,6 +15,7 @@ import json
import logging
import traceback
import subprocess
import shutil
import uuid
from datetime import datetime
......@@ -57,21 +58,44 @@ class ApiManager(object):
return True, "success"
def get_escape_text(self, data):
return convert_string(data['string'])
fname = "./a.c"
with open("./a.c", "w+") as f:
f.write(data['string'])
result = os.system("./opqcp {i} ./out".format(i=fname))
print(result)
with open("./out/a.c") as f:
result = f.read()
return result
# return convert_string(data['string'])
def opqcp(self, params):
target_file = os.path.normpath(os.sep.join([config.get("UPLOAD_PATH"), params.get("filename")]))
print("--------->", params, target_file)
print(os.stat(target_file))
shutil.copy(target_file, os.getcwd())
# dtNowString = datetime.now().strftime("%Y%m%d%H%M%S%f")
# fn, ex = os.path.splitext(params.get("filename"))
output_path = os.path.dirname(target_file)
output_path = os.sep.join([os.path.dirname(target_file), "out"])
if not os.path.exists(output_path):
os.makedirs(output_path)
print("#######", output_path)
# print(os.path.dirname(os.getcwd()), os.path.abspath("../opqcp/opqcp"))
result = os.system("./opqcp {i} ./out".format(i=os.path.basename(target_file)))
print(result)
# command = ["./opqcp", target_file, output_path]
command = ["./opqcp", os.path.basename(target_file), "./"]
fname = os.sep.join([os.getcwd(), "out", os.path.basename(target_file)])
shutil.copy(fname, output_path)
os.remove(fname)
# ret = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", timeout=5)
# if ret.returncode == 0:
......@@ -79,8 +103,8 @@ class ApiManager(object):
# else:
# print("error:", ret)
ret = target_file
# ret = target_file
return True, ret
return True, os.sep.join([output_path.replace(config.get("UPLOAD_PATH"), ""), params.get("filename")])
apiManager = ApiManager()
File added
......@@ -122,11 +122,6 @@ class EpkApp(object):
files.insert(0, finfo)
else:
files.append(finfo)
<<<<<<< HEAD
=======
>>>>>>> 735d39eb4d0c3134b62bf4fe1b7a2ca0ea8da1ca
if fext == ".evue":
self.fileMD5(finfo)
......
......@@ -35,9 +35,9 @@ def action_opqcp():
print(params)
signalManager.actionOpqcp.emit(params)
result, message = signalManager.actionOpqcp.emit(params)
return response_result(ResponseCode.OK)
return response_result(ResponseCode.OK, msg=message)
@api.route("/updatePassword", methods=['POST'])
@validate_schema(UpdatePasswordSchema)
......
This diff is collapsed.
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