diff --git a/composer.py b/composer.py new file mode 100644 index 0000000..e69de29 diff --git a/config.toml b/config.toml index e64f846..538c6d0 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ # [调试] 将更改保存到文件 save = 1 # [调试] 覆写时间 -time_override = 11 +time_override = 10 # 对于每个项目的新记忆核子数量 tasked_number = 12 # 竖屏适配 diff --git a/install.bat b/install.bat new file mode 100644 index 0000000..f86b95b --- /dev/null +++ b/install.bat @@ -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 \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..043d584 --- /dev/null +++ b/install.sh @@ -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 的环境依赖已安装" \ No newline at end of file diff --git a/main.py b/main.py index c8d03bc..8538e7e 100644 --- a/main.py +++ b/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") diff --git a/playsound_android.py b/playsound_android.py deleted file mode 100644 index 43a6016..0000000 --- a/playsound_android.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Android Termux 无法编译 playsound 库的替代方案, -需要安装 playaudio, 并重命名此文件至 playsound.py""" -import os -def playsound(path): - os.system(f"play-audio '{path}'") \ No newline at end of file diff --git a/precaching.py b/precaching.py index ce56652..9b94f6d 100644 --- a/precaching.py +++ b/precaching.py @@ -1,3 +1,4 @@ +# 音频预缓存实用程序, 独立于主程序之外, 但依赖 particles 组件 import particles as pt import edge_tts as tts from pathlib import Path diff --git a/reactor.py b/reactor.py index fa98687..8abb0b8 100644 --- a/reactor.py +++ b/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, diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2f45bf1 --- /dev/null +++ b/requirements.txt @@ -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 \ No newline at end of file diff --git a/todo.md b/todo.md deleted file mode 100644 index 04521a3..0000000 --- a/todo.md +++ /dev/null @@ -1,3 +0,0 @@ -- [] 基于释义的评估 -> 使用 EFACTOR 取最低值方法 -- [] 附加属性 \ No newline at end of file