完善项目安装配置 & 中途改进
This commit is contained in:
0
composer.py
Normal file
0
composer.py
Normal file
@@ -1,7 +1,7 @@
|
||||
# [调试] 将更改保存到文件
|
||||
save = 1
|
||||
# [调试] 覆写时间
|
||||
time_override = 11
|
||||
time_override = 10
|
||||
# 对于每个项目的新记忆核子数量
|
||||
tasked_number = 12
|
||||
# 竖屏适配
|
||||
|
40
install.bat
Normal file
40
install.bat
Normal file
@@ -0,0 +1,40 @@
|
||||
@echo off
|
||||
echo "HeurAMS 环境安装脚本"
|
||||
echo "正在检测系统中是否安装 Python 3.x..."
|
||||
|
||||
rem 检查 Python 3 是否存在
|
||||
where python >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo "错误: 未检测到 Python. 请确保 Python 已添加到系统 PATH 中,然后再次运行此脚本。"
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
rem 检查 Python 版本是否为 3.x
|
||||
for /f "tokens=*" %%i in ('python -c "import sys; print(f'{sys.version_info.major}')"') do set PYTHON_MAJOR_VERSION=%%i
|
||||
if "%PYTHON_MAJOR_VERSION%"=="3" (
|
||||
for /f "tokens=*" %%i in ('python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"') do set PYTHON_VERSION=%%i
|
||||
echo "检测到 Python 3 已安装, 版本为: %PYTHON_VERSION%"
|
||||
) else (
|
||||
echo "错误: 未检测到 Python 3. 请先安装 Python 3, 然后再次运行此脚本."
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo "---"
|
||||
echo "正在安装 requirements.txt 中的依赖..."
|
||||
|
||||
rem 检查 requirements.txt 文件是否存在
|
||||
if exist "requirements.txt" (
|
||||
python -m pip install -r requirements.txt
|
||||
if %errorlevel% equ 0 (
|
||||
echo "依赖安装成功."
|
||||
) else (
|
||||
echo "错误: 依赖安装失败. 请检查 requirements.txt 文件或网络连接."
|
||||
exit /b 1
|
||||
)
|
||||
) else (
|
||||
echo "警告: 未找到 requirements.txt 文件. 跳过依赖安装."
|
||||
)
|
||||
|
||||
echo "---"
|
||||
echo "HeurAMS 的环境依赖已安装"
|
||||
pause
|
28
install.sh
Normal file
28
install.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "HeurAMS 环境安装脚本"
|
||||
echo "正在检测系统中是否安装 Python 3.x..."
|
||||
if command -v python3 &>/dev/null; then
|
||||
PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
|
||||
echo "检测到 Python 3 已安装, 版本为: ${PYTHON_VERSION}"
|
||||
else
|
||||
echo "错误: 未检测到 Python 3. 请先安装 Python 3, 然后再次运行此脚本. "
|
||||
exit 1 # 退出脚本, 因为 Python 3 是必需的
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo "正在安装 requirements.txt 中的依赖..."
|
||||
if [ -f "requirements.txt" ]; then
|
||||
python3 -m pip install -r requirements.txt
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "依赖安装成功. "
|
||||
else
|
||||
echo "错误: 依赖安装失败. 请检查 requirements.txt 文件或网络连接. "
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "警告: 未找到 requirements.txt 文件. 跳过依赖安装. "
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo "HeurAMS 的环境依赖已安装"
|
2
main.py
2
main.py
@@ -12,7 +12,7 @@ import particles as pt
|
||||
from reactor import Reactor
|
||||
import auxiliary as aux
|
||||
|
||||
ver = '0.2.9'
|
||||
ver = '0.3.0'
|
||||
|
||||
config = aux.ConfigFile("config.toml")
|
||||
|
||||
|
@@ -1,5 +0,0 @@
|
||||
"""Android Termux 无法编译 playsound 库的替代方案,
|
||||
需要安装 playaudio, 并重命名此文件至 playsound.py"""
|
||||
import os
|
||||
def playsound(path):
|
||||
os.system(f"play-audio '{path}'")
|
@@ -1,3 +1,4 @@
|
||||
# 音频预缓存实用程序, 独立于主程序之外, 但依赖 particles 组件
|
||||
import particles as pt
|
||||
import edge_tts as tts
|
||||
from pathlib import Path
|
||||
|
21
reactor.py
21
reactor.py
@@ -3,11 +3,24 @@ import particles as pt
|
||||
import pathlib
|
||||
import auxiliary as aux
|
||||
|
||||
class Parser():
|
||||
"""轻量级版本文件解析器, 用于文件管理器的记忆状态解析"""
|
||||
class Apparatus():
|
||||
"""反应器对象, 处理一个原子的记忆工作, 并反馈到布局"""
|
||||
def __init__(self, atom):
|
||||
self.electron = atom[0]
|
||||
self.nucleon = atom[1]
|
||||
|
||||
def report(self):
|
||||
pass
|
||||
|
||||
def assess(self):
|
||||
pass
|
||||
|
||||
def iterate(self):
|
||||
pass
|
||||
|
||||
|
||||
class Reactor():
|
||||
"""反应堆对象, 用于全面解析文件, 并处理和分配一次文件记忆流程的资源与策略"""
|
||||
"""反应堆对象, 处理和分配一次文件记忆流程的资源与策略"""
|
||||
def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, tasked_num):
|
||||
# 导入原子对象
|
||||
self.reported = set()
|
||||
@@ -65,8 +78,6 @@ class Reactor():
|
||||
2: "新记忆模式",
|
||||
3: "总复习模式"
|
||||
}
|
||||
print("Atoms New:", self.atoms_new)
|
||||
print("Atoms Review:", self.atoms_review)
|
||||
|
||||
processions = {
|
||||
1: self.atoms_review,
|
||||
|
8
requirements.txt
Normal file
8
requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
aiohttp==3.12.13
|
||||
aiohttp_jinja2==1.6
|
||||
edge_tts==7.0.2
|
||||
Jinja2==3.1.6
|
||||
playsound==1.2.2
|
||||
rich==14.1.0
|
||||
textual==5.0.1
|
||||
toml==0.10.2
|
Reference in New Issue
Block a user