添加README
This commit is contained in:
12
Html/app.py
12
Html/app.py
@@ -9,7 +9,8 @@ import sys
|
||||
import json
|
||||
parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
sys.path.insert(0, parent_dir)
|
||||
student_workspace_root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../study'))
|
||||
student_workspace_root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../study'))
|
||||
|
||||
current_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '.'))
|
||||
sys.path.insert(0, current_dir)
|
||||
from AlgoriAgent.projects.algoriAgent.agent_manager import AgentManager
|
||||
@@ -276,11 +277,14 @@ def desktop(user_id, course_id, chapter_id):
|
||||
os.makedirs(path_dir, exist_ok=True)
|
||||
# 在此文件夹内部创建一个.config文件,并写入 user_id=user_id\n path=path
|
||||
config_path = os.path.join(path_dir, '.config')
|
||||
print('---------------------')
|
||||
print(config_path)
|
||||
with open(config_path, 'w') as f:
|
||||
if GLOBAL_CONFIG['VSCODE_WEB_PATH']['is_wsl']: # 如果是在 WSL 中运行,则将路径转换为 WSL 路径
|
||||
path_dir = path_dir.replace('\\', '/')
|
||||
path_dir = path_dir.replace(GLOBAL_CONFIG['VSCODE_WEB_PATH']['windows_path'] , GLOBAL_CONFIG['VSCODE_WEB_PATH']['wsl_path'])
|
||||
with open(config_path, 'w', encoding='utf-8') as f:
|
||||
tmpd = {'user_id': user_id, 'course_id': course_id, 'chapter_id': chapter_id, 'path': path_dir}
|
||||
json.dump(tmpd, f)
|
||||
print('---------------------')
|
||||
print(config_path)
|
||||
return render_template('desktop.html', vscode_web_url=VSCODE_WEB_URL, user_id=user_id, course_id=course_id, chapter_id=chapter_id, workspace_path=path_dir)
|
||||
|
||||
@app.route('/desktop_nouser/<course_id>/<chapter_id>')
|
||||
|
||||
Reference in New Issue
Block a user