mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2026-01-26 05:32:20 +00:00
优化教程·其二
This commit is contained in:
@@ -36,7 +36,7 @@ RUN python3 -m venv /app/venv
|
|||||||
RUN . /app/venv/bin/activate && \
|
RUN . /app/venv/bin/activate && \
|
||||||
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
||||||
/app/venv/bin/python3 -m pip install --upgrade pip && \
|
/app/venv/bin/python3 -m pip install --upgrade pip && \
|
||||||
pip install --no-cache-dir --upgrade "Musicreater[full]" TrimLog requests zhDateTime "setuptools<80"
|
pip install --no-cache-dir --upgrade /app/Linglun-Converter/requirements_cli.txt
|
||||||
|
|
||||||
# 切换到克隆下来的仓库目录
|
# 切换到克隆下来的仓库目录
|
||||||
WORKDIR /app/Linglun-Converter
|
WORKDIR /app/Linglun-Converter
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
这里我们选用 **Termux** 作为我们的终端工具来安装,这是一个强大的终端模拟器,旨在安卓环境下模拟Linux的软件包环境。
|
这里我们选用 **Termux** 作为我们的终端工具来安装,这是一个强大的终端模拟器,旨在安卓环境下模拟Linux的软件包环境。
|
||||||
|
|
||||||
|
> **注意** 若你的设备中已经有终端工具(例如 Utermux 之类的),请跳过此步骤。
|
||||||
|
|
||||||
1. 下载
|
1. 下载
|
||||||
|
|
||||||
下载可以通过 [GitHub源](https://github.com/termux/termux-app/releases) 或者 [F-Droid源](https://f-droid.org/en/packages/com.termux/) ,个人建议选择 F-Droid 源,因为在国内可以访问得到,而 GitHub 源就看运气。
|
下载可以通过 [GitHub源](https://github.com/termux/termux-app/releases) 或者 [F-Droid源](https://f-droid.org/en/packages/com.termux/) ,个人建议选择 F-Droid 源,因为在国内可以访问得到,而 GitHub 源就看运气。
|
||||||
@@ -26,6 +28,8 @@
|
|||||||
|
|
||||||
首先,我估计你等不了多久,急得要死,所以我们要让下载速度稍微快一点,先来换个源。在 **Termux** 中,输入以下指令:
|
首先,我估计你等不了多久,急得要死,所以我们要让下载速度稍微快一点,先来换个源。在 **Termux** 中,输入以下指令:
|
||||||
|
|
||||||
|
> **注意** 这条指令很长,执行时请左右滑动以复制全部内容。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo "deb https://mirror.mwt.me/termux/main stable main" > /data/data/com.termux/files/usr/etc/apt/sources.list
|
echo "deb https://mirror.mwt.me/termux/main stable main" > /data/data/com.termux/files/usr/etc/apt/sources.list
|
||||||
```
|
```
|
||||||
@@ -34,7 +38,9 @@
|
|||||||
|
|
||||||
- *非必要步骤*:手动编辑换源
|
- *非必要步骤*:手动编辑换源
|
||||||
|
|
||||||
如果你闲着没事,非要要手动编辑个文档来换源,那用啥?用普通的编辑器肯定可以,于是我们就让他更普通一点,用**nano**吧!
|
> **注意** 这是非必要的步骤,执行了也没有好处,小白别闲着没事干。
|
||||||
|
|
||||||
|
如果你闲着没事,非要要手动编辑个文档来换源,那就可以遵循这一部分的内容,我们先打开 **nano** 吧。
|
||||||
|
|
||||||
在 **Termux** 中,输入以下指令:
|
在 **Termux** 中,输入以下指令:
|
||||||
|
|
||||||
@@ -59,13 +65,13 @@
|
|||||||
|
|
||||||
然后键入 `Ctrl`+`S`,再键入 `Ctrl`+`X`,退出`nano`。
|
然后键入 `Ctrl`+`S`,再键入 `Ctrl`+`X`,退出`nano`。
|
||||||
|
|
||||||
在换源之后,你可能会见到类似的提示:
|
在换源之后,你可能会见到类似的提示(“可能会”的意思是也可能不会):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Your '/data/data/com.termux/files/usr/etc/apt/sources.list' file changed. Please run 'apt-get update'.
|
Your '/data/data/com.termux/files/usr/etc/apt/sources.list' file changed. Please run 'apt-get update'.
|
||||||
```
|
```
|
||||||
|
|
||||||
那就遵循它的指引,输入:
|
那就遵循它的指引(但无论出没出现上面的那个提示,都请执行下面的指令),输入:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
apt-get update
|
apt-get update
|
||||||
@@ -94,35 +100,24 @@
|
|||||||
|
|
||||||
如果输出了形如 `Python 3.X.X` 的提示,则完成。
|
如果输出了形如 `Python 3.X.X` 的提示,则完成。
|
||||||
|
|
||||||
3. 安装依赖库
|
3. 构建环境并安装依赖库
|
||||||
|
|
||||||
|
以下长段中井号“#”开头的是注释,无需复制输入。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 首先换源
|
# 首先换源
|
||||||
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
|
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
|
||||||
# 然后安装(依次执行下面的指令)
|
# 然后安装 numpy
|
||||||
apt-get install python-numpy
|
apt-get install python-numpy
|
||||||
pip install -r requirements_cli.txt
|
# 新建虚拟环境
|
||||||
```
|
python -m venv ./.venv
|
||||||
|
|
||||||
- 如果出现以下情况,真是死了鬼的,我们要来再搞个设置:
|
|
||||||
|
|
||||||
<img height="512" src="https://foruda.gitee.com/images/1665933289612919459/b87b7804_9911226.jpeg">
|
|
||||||
|
|
||||||
我们来修改收信任的源设置:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pip config set global.trusted-host mirrors.aliyun.com/
|
|
||||||
```
|
|
||||||
|
|
||||||
之后再来安装即可
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python -m pip install --upgrade -r requirements_cli.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
安装成功后您可能会见到类似下图的提示:
|
安装成功后您可能会见到类似下图的提示:
|
||||||
|
|
||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
-->
|
||||||
|
|
||||||
### 安装下载工具
|
### 安装下载工具
|
||||||
|
|
||||||
@@ -132,15 +127,23 @@
|
|||||||
apt install git
|
apt install git
|
||||||
```
|
```
|
||||||
|
|
||||||
安装完成后记得测试一下:
|
安装完成后可以测试一下是否安装成功:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git --version
|
||||||
|
```
|
||||||
|
|
||||||
|
你可能会见到类似 `git version 2.x.x` 的提示,表示安装成功。
|
||||||
|
|
||||||
|
<!--
|
||||||
<img height="512" src="https://foruda.gitee.com/images/1665933331269483373/9374c85d_9911226.jpeg">
|
<img height="512" src="https://foruda.gitee.com/images/1665933331269483373/9374c85d_9911226.jpeg">
|
||||||
|
-->
|
||||||
|
|
||||||
## 本软件的下载与使用
|
## 本软件的下载与使用
|
||||||
|
|
||||||
1. 使用Git下载本程序代码
|
0. 使用Git下载本程序代码
|
||||||
|
|
||||||
```bash
|
```git
|
||||||
git clone https://gitee.com/TriM-Organization/Linglun-Converter.git llc
|
git clone https://gitee.com/TriM-Organization/Linglun-Converter.git llc
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -153,13 +156,20 @@ apt install git
|
|||||||
|
|
||||||
1. 开始使用命令行程序
|
1. 开始使用命令行程序
|
||||||
|
|
||||||
依照你的需要,执行以下命令以运行程序:
|
执行以下命令以运行伶伦转换器:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python llc_cli.py
|
source ./run_cli.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
运行成功了,哦耶!
|
运行成功了,哦耶!
|
||||||
|
|
||||||
<img height="512" src="https://foruda.gitee.com/images/1686963721390700714/b82fb3d5_9911226.png">
|
<img height="512" src="https://foruda.gitee.com/images/1686963721390700714/b82fb3d5_9911226.png">
|
||||||
|
|
||||||
|
2. 软件更新
|
||||||
|
|
||||||
|
有时可能需要更新本程序,请在进入到本程序所在的文件夹(上述`cd llc`即此)后,执行以下命令:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git pull
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
## 1控制台 使用 Docker
|
## 一、【控制台】使用 Docker
|
||||||
|
|
||||||
请使用根目录下的 `Dockerfile` 来构建镜像,并运行镜像。
|
请使用根目录下的 `Dockerfile` 来构建镜像,并运行镜像。
|
||||||
|
|
||||||
## 2图形化用户界面
|
## 二、【图形化用户界面】暂无内容
|
||||||
|
|
||||||
*未完待续*
|
*未完待续*
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
## 3**不建议** 手动安装
|
## 三、【控制台】手动安装(*不建议*)
|
||||||
|
|
||||||
### 运行环境安装
|
### 运行环境安装
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
# 安装完成后一定要验证!!!
|
# 安装完成后一定要验证!!!
|
||||||
python -m pip
|
python -m pip
|
||||||
```
|
```
|
||||||
|
<!--
|
||||||
2. 确认完成之后,我们来安装一下依赖库:
|
2. 确认完成之后,我们来安装一下依赖库:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
3. 安装成功后可能会见到类似下图的提示:
|
3. 安装成功后可能会见到类似下图的提示:
|
||||||
|
|
||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
-->
|
||||||
|
|
||||||
### 本代码库的下载与使用
|
### 本代码库的下载与使用
|
||||||
|
|
||||||
@@ -105,11 +105,20 @@
|
|||||||
cd llc
|
cd llc
|
||||||
```
|
```
|
||||||
|
|
||||||
1. 开始使用
|
1. 新建虚拟环境
|
||||||
|
|
||||||
在目录下打开终端,执行以下命令以运行演示程序:
|
在目录下打开终端,或者继续沿用我们刚才已经`cd`过`llc`的终端,执行以下命令以新建虚拟环境:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python llc_cli.py
|
python -m venv ./.venv
|
||||||
```
|
```
|
||||||
|
|
||||||
|
2. 运行示例程序
|
||||||
|
|
||||||
|
执行以下命令以运行演示程序:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source ./run_cli.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
该脚本会自动激活虚拟环境,你也可以通过手动执行`source ./.venv/bin/activate`来激活之。
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
## 运行打包文件(推荐)
|
## 运行可执行文件(推荐)
|
||||||
|
|
||||||
### 一、下载打包好的应用程序
|
### 一、下载打包好的应用程序
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<img src=https://foruda.gitee.com/images/1699106948861444130/30c156bc_9911226.png>
|
<img src=https://foruda.gitee.com/images/1699106948861444130/30c156bc_9911226.png>
|
||||||
|
|
||||||
|
|
||||||
## 从代码运行(最新功能)
|
## 从代码运行(不建议)
|
||||||
|
|
||||||
### 一、运行环境安装
|
### 一、运行环境安装
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
1. 首先需要下载Python的安装包,最好是 *Python3.10*,因为作者就用的是这个版本
|
1. 首先需要下载Python的安装包,最好是 *Python3.10*,因为作者就用的是这个版本
|
||||||
|
|
||||||
!注意!此程序现已不支持Python3.6。请更新到至少Python3.8,但是,我们对于Python3.8的支持也即将停止,为了更好的兼容,避免不必要的麻烦,我们强烈建议您更新到Python3.10。(这意味着我们即将放弃对Windows7的支持)
|
!注意!此程序现已不支持 Python3.6。请更新到至少Python3.8,但是,我们对于 Python3.8 的支持也即将停止,为了更好的兼容,避免不必要的麻烦,我们强烈建议您更新到 Python3.10。(这意味着我们即将放弃对 Windows7 的支持)
|
||||||
|
|
||||||
> [下载64位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe)
|
> [下载64位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe)
|
||||||
> [下载32位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe)
|
> [下载32位Python3.10安装包](https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe)
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
|
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
|
||||||
|
|
||||||
4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入:`python -V` 试试是否安装成功,成功安装之后,在终端中输入python会显示诸如如下图片的提示:
|
4. 安装结束之后可以在*终端*工具(例如 命令行/PowerShell/Bash 之类的都是终端工具)中输入:`python -V` 试试是否安装成功,成功安装之后,在终端中输入python会显示诸如如下图片的提示:
|
||||||
|
|
||||||
<img src=https://foruda.gitee.com/images/1699107336707287940/1837e2f6_9911226.png>
|
<img src=https://foruda.gitee.com/images/1699107336707287940/1837e2f6_9911226.png>
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
1. 开始使用
|
1. 开始使用
|
||||||
|
|
||||||
您可以直接双击 `llc_cli.py` 以运行演示程序,或者按照以下步骤使用终端应用运行。
|
您可以直接双击 `llc_cli.py` 以运行软件,或者按照以下步骤使用终端应用运行。
|
||||||
|
|
||||||
在目录下打开终端。
|
在目录下打开终端。
|
||||||
|
|
||||||
|
|||||||
14
llc_cli.py
14
llc_cli.py
@@ -19,12 +19,14 @@ The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan.
|
|||||||
详细的准许和限制条款请见原协议文本。
|
详细的准许和限制条款请见原协议文本。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.0.9.1"
|
__version__ = "0.0.9.2"
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
import Musicreater
|
import Musicreater
|
||||||
from Musicreater import DEFAULT_PROGRESSBAR_STYLE
|
from Musicreater import DEFAULT_PROGRESSBAR_STYLE
|
||||||
from Musicreater.plugin.addonpack import (
|
from Musicreater.plugin.addonpack import (
|
||||||
@@ -42,6 +44,16 @@ from Musicreater.plugin.mcstructfile import (
|
|||||||
from utils.io import bool_str, float_str, int_str, ipt, isin, logger, prt
|
from utils.io import bool_str, float_str, int_str, ipt, isin, logger, prt
|
||||||
from utils.yanlun import solar_date, yanlun_texts
|
from utils.yanlun import solar_date, yanlun_texts
|
||||||
|
|
||||||
|
except ImportError:
|
||||||
|
if input("[ERROR] 当前环境中未安装所需依赖库,是否直接安装依赖库?[Y/n]") in (
|
||||||
|
"y",
|
||||||
|
"Y",
|
||||||
|
):
|
||||||
|
os.system("pip install -r ./requirements_cli.txt")
|
||||||
|
print("[INFO] 安装完成,请重新启动。")
|
||||||
|
|
||||||
|
exit()
|
||||||
|
|
||||||
# import sys
|
# import sys
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
setuptools < 80
|
||||||
Musicreater[full]>=2.1.0.1
|
Musicreater[full]>=2.1.0.1
|
||||||
TrimLog>=0.8.3
|
TrimLog>=0.8.3
|
||||||
setuptools < 81
|
|
||||||
requests>=2.0.0
|
requests>=2.0.0
|
||||||
zhDateTime>=2.0.0
|
zhDateTime>=2.0.0
|
||||||
2
run_cli.sh
Normal file
2
run_cli.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
source ./.venv/bin/activate
|
||||||
|
python ./llc_cli.py
|
||||||
Reference in New Issue
Block a user