mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2026-01-25 13:11:58 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
680e8f5d3b | ||
|
|
8584f8df33 | ||
|
|
f8e073a2a9 | ||
|
|
2ff857fce7 | ||
|
|
b2fd1c331b | ||
|
|
c4b1202523 | ||
|
|
782b88e3c4 | ||
|
|
bcdb9fc51c |
14
Dockerfile
14
Dockerfile
@@ -1,13 +1,16 @@
|
|||||||
|
# 从镜像站点拷贝基础系统
|
||||||
FROM docker.1ms.run/library/python:3.10-slim-bullseye
|
FROM docker.1ms.run/library/python:3.10-slim-bullseye
|
||||||
|
|
||||||
ENV TZ Asia/Taipei
|
ENV TZ Asia/Taipei
|
||||||
|
|
||||||
|
# 工作目录
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
# 省的说我给人删了不备份
|
||||||
RUN touch /etc/apt/sources.list
|
RUN touch /etc/apt/sources.list
|
||||||
|
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||||
|
|
||||||
|
# 换源!!
|
||||||
RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \
|
RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \
|
||||||
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \
|
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \
|
||||||
echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
|
echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
|
||||||
@@ -18,21 +21,22 @@ RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib"
|
|||||||
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list
|
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list
|
||||||
|
|
||||||
|
|
||||||
|
# 下个 Git
|
||||||
RUN apt-get update && apt-get install -y git && \
|
RUN apt-get update && apt-get install -y git && \
|
||||||
# 清理 apt 缓存
|
# 清理 apt 缓存
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 克隆指定的 git 仓库
|
# 克隆伶伦仓库
|
||||||
RUN git clone https://gitee.com/TriM-Organization/Linglun-Converter.git
|
RUN git clone https://gitee.com/TriM-Organization/Linglun-Converter.git
|
||||||
|
|
||||||
# 创建 Python 虚拟环境
|
# 创建 Python 虚拟环境
|
||||||
RUN python3 -m venv /app/venv
|
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
|
pip install --no-cache-dir --upgrade /app/Linglun-Converter/requirements_cli.txt
|
||||||
|
|
||||||
# 切换到克隆下来的仓库目录
|
# 切换到克隆下来的仓库目录
|
||||||
WORKDIR /app/Linglun-Converter
|
WORKDIR /app/Linglun-Converter
|
||||||
|
|||||||
34
clean_pycache.py
Normal file
34
clean_pycache.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
from rich.console import Console
|
||||||
|
from rich.progress import track
|
||||||
|
|
||||||
|
console = Console()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
with console.status("正在搜寻可清理之文件"):
|
||||||
|
egg_info: list = []
|
||||||
|
for file in os.listdir():
|
||||||
|
if file.endswith((".egg-info", ".spec")):
|
||||||
|
egg_info.append(file)
|
||||||
|
console.print(file)
|
||||||
|
|
||||||
|
pycache: list = []
|
||||||
|
for dirpath, dirnames, filenames in os.walk("./"):
|
||||||
|
for dirname in dirnames:
|
||||||
|
if dirname == "__pycache__":
|
||||||
|
pycache.append(fn := os.path.join(dirpath, dirname))
|
||||||
|
console.print(fn)
|
||||||
|
for file in track(
|
||||||
|
["build", "dist", "logs", "log", *egg_info, *pycache], description="正在清理"
|
||||||
|
):
|
||||||
|
if os.path.isdir(file) and os.access(file, os.W_OK):
|
||||||
|
shutil.rmtree(file)
|
||||||
|
elif os.path.isfile(file) and os.access(file, os.W_OK):
|
||||||
|
os.remove(file)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -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,37 +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 Musicreater[full] TrimLog
|
# 新建虚拟环境
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
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
|
|
||||||
pip install Musicreater[full] TrimLog
|
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
安装成功后您可能会见到类似下图的提示:
|
安装成功后您可能会见到类似下图的提示:
|
||||||
|
|
||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
-->
|
||||||
|
|
||||||
### 安装下载工具
|
### 安装下载工具
|
||||||
|
|
||||||
@@ -134,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
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -155,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,7 +1,20 @@
|
|||||||
|
|
||||||
## 运行环境安装
|
|
||||||
|
|
||||||
### 检验Python运行环境
|
## 一、【控制台】使用 Docker
|
||||||
|
|
||||||
|
请使用根目录下的 `Dockerfile` 来构建镜像,并运行镜像。
|
||||||
|
|
||||||
|
## 二、【图形化用户界面】暂无内容
|
||||||
|
|
||||||
|
*未完待续*
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## 三、【控制台】手动安装(*不建议*)
|
||||||
|
|
||||||
|
### 运行环境安装
|
||||||
|
|
||||||
|
#### 检验Python运行环境
|
||||||
|
|
||||||
0. 一般的Linux发行版都有安装Python环境,我们只需要保证其版本即可,理论上 ≥Python3.6 都可以运行我们的库
|
0. 一般的Linux发行版都有安装Python环境,我们只需要保证其版本即可,理论上 ≥Python3.6 都可以运行我们的库
|
||||||
|
|
||||||
@@ -43,7 +56,7 @@
|
|||||||
|
|
||||||
暂无
|
暂无
|
||||||
|
|
||||||
### 检查并安装pip包管理器依赖
|
#### 检查并安装pip包管理器依赖
|
||||||
|
|
||||||
1. 我们在安装依赖库之前,应该确认一下,Python自带的包管理器pip是否安装到位:
|
1. 我们在安装依赖库之前,应该确认一下,Python自带的包管理器pip是否安装到位:
|
||||||
|
|
||||||
@@ -65,20 +78,19 @@
|
|||||||
# 安装完成后一定要验证!!!
|
# 安装完成后一定要验证!!!
|
||||||
python -m pip
|
python -m pip
|
||||||
```
|
```
|
||||||
|
<!--
|
||||||
2. 确认完成之后,我们来安装一下依赖库:
|
2. 确认完成之后,我们来安装一下依赖库:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install Musicreater[full] -i https://mirrors.aliyun.com/pypi/simple/
|
pip install -r requirements_cli.txt -i https://mirrors.aliyun.com/pypi/simple/
|
||||||
pip install TrimLog -i https://mirrors.aliyun.com/pypi/simple/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 安装成功后可能会见到类似下图的提示:
|
3. 安装成功后可能会见到类似下图的提示:
|
||||||
|
|
||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
-->
|
||||||
|
|
||||||
|
### 本代码库的下载与使用
|
||||||
## 本代码库的下载与使用
|
|
||||||
|
|
||||||
1. 使用Git下载本库及其示例代码
|
1. 使用Git下载本库及其示例代码
|
||||||
|
|
||||||
@@ -93,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` 以运行软件,或者按照以下步骤使用终端应用运行。
|
||||||
|
|
||||||
在目录下打开终端。
|
在目录下打开终端。
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,21 @@
|
|||||||
|
|
||||||
## Install Runtime Environment
|
|
||||||
|
|
||||||
### Install and Verify Python Runtime
|
|
||||||
|
## 1 CLI - Docker
|
||||||
|
|
||||||
|
Using the `Dockerfile` in the root directory to build a Docker image, and run it.
|
||||||
|
|
||||||
|
## 2 GUI
|
||||||
|
|
||||||
|
*to be written*
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
## 3 **Not Recommended** Manually Run the CLI code
|
||||||
|
|
||||||
|
### Install Runtime Environment
|
||||||
|
|
||||||
|
#### Install and Verify Python Runtime
|
||||||
|
|
||||||
0. Common Linux Distributions do include a Python Runtime Environment, what we should do is only to check whether it is a satisfied version to our program. If the version ≥Python3.6, theoretically our program can be run.
|
0. Common Linux Distributions do include a Python Runtime Environment, what we should do is only to check whether it is a satisfied version to our program. If the version ≥Python3.6, theoretically our program can be run.
|
||||||
|
|
||||||
@@ -43,7 +57,7 @@
|
|||||||
|
|
||||||
None yet.
|
None yet.
|
||||||
|
|
||||||
### Install and Verify pip Package Manager
|
#### Install and Verify pip Package Manager
|
||||||
|
|
||||||
1. Before installing, it is to be checked, wheather Python's pip is OK:
|
1. Before installing, it is to be checked, wheather Python's pip is OK:
|
||||||
|
|
||||||
@@ -55,22 +69,21 @@
|
|||||||
/usr/bin/python: No module named pip
|
/usr/bin/python: No module named pip
|
||||||
# We can install pip via:
|
# We can install pip via:
|
||||||
sudo pacman -S python-pip
|
sudo pacman -S python-pip
|
||||||
# Verfy, remember.
|
# Check, remember.
|
||||||
python -m pip
|
python -m pip
|
||||||
|
|
||||||
|
|
||||||
# If you did but failed, we should use other methods to install pip:
|
# If you did but failed, we should use other methods to install pip:
|
||||||
wget https://bootstrap.pypa.io/get-pip.py
|
wget https://bootstrap.pypa.io/get-pip.py
|
||||||
sudo python get-pip.py
|
sudo python get-pip.py
|
||||||
# Verfy, must.
|
# Double check, must.
|
||||||
python -m pip
|
python -m pip
|
||||||
```
|
```
|
||||||
|
|
||||||
2. After checking, let's install the dependences.
|
2. After checking, let's install the dependences.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install mido -i
|
pip install -r requirements_cli.txt -i https://mirrors.aliyun.com/pypi/simple/
|
||||||
pip install brotli -i
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3. See the tips below as successfully installed:
|
3. See the tips below as successfully installed:
|
||||||
@@ -78,25 +91,25 @@
|
|||||||
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
|
||||||
|
|
||||||
|
|
||||||
## Download this lib's sources code and Using its demos.
|
### Download this lib's sources code and Using its demos.
|
||||||
|
|
||||||
1. Download via Git
|
1. Download via Git
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone -b pkgver https://github.com/TriM-Organization/Musicreater.git MSCTpkgver
|
git clone https://gitee.com/TriM-Organization/Linglun-Converter.git llc
|
||||||
```
|
```
|
||||||
|
|
||||||
If succeed, a directory named `MSCTpkgver` well be found in the path you run this command, and inside it is the source code and demo(s) we wantted to download.
|
If succeed, a directory named `llc` well be found in the path you run this command, and inside it is the source codes we wantted to download.
|
||||||
What we want to use is the demo(s) so enter the folder via:
|
What we want to use is in the folder so enter the folder via:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd MSCTpkgver
|
cd llc
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Starting Using Demo(s)
|
1. Starting Using
|
||||||
|
|
||||||
Via
|
Via
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python magicDemo.py
|
python llc_cli.py
|
||||||
```
|
```
|
||||||
|
|||||||
17
llc_cli.py
17
llc_cli.py
@@ -19,12 +19,14 @@ The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan.
|
|||||||
详细的准许和限制条款请见原协议文本。
|
详细的准许和限制条款请见原协议文本。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.0.9"
|
__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,8 +44,17 @@ 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
|
||||||
|
|
||||||
# import sys
|
except ImportError:
|
||||||
|
if input("[ERROR] 当前环境中未安装所需依赖库,是否直接安装依赖库?[Y/n]") in (
|
||||||
|
"y",
|
||||||
|
"Y",
|
||||||
|
):
|
||||||
|
os.system("pip install -r ./requirements_cli.txt")
|
||||||
|
print("[INFO] 安装完成,请重新启动。")
|
||||||
|
|
||||||
|
exit()
|
||||||
|
|
||||||
|
# import sys
|
||||||
|
|
||||||
|
|
||||||
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
||||||
@@ -379,7 +390,7 @@ for singleMidi in midis:
|
|||||||
else to_BDX_file_in_delay(cvt_mid, out_path, style, *prompts[3:])
|
else to_BDX_file_in_delay(cvt_mid, out_path, style, *prompts[3:])
|
||||||
)
|
)
|
||||||
if output_file_format == 1
|
if output_file_format == 1
|
||||||
else (cvt_method(cvt_mid, out_path, *prompts[2:]))
|
else (cvt_method(cvt_mid, out_path, *prompts[2:])) # type: ignore
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ from utils.io import TrimLog, log__init__, logger, object_constants
|
|||||||
from utils.packdata import enpack_llc_pack, load_msct_packed_data, unpack_llc_pack
|
from utils.packdata import enpack_llc_pack, load_msct_packed_data, unpack_llc_pack
|
||||||
from utils.update_check import check_update_release
|
from utils.update_check import check_update_release
|
||||||
from utils.webview import go_update_tip
|
from utils.webview import go_update_tip
|
||||||
from utils.yanlun import yanlun_bg_colour, yanlun_fg_colour, yanlun_texts
|
from utils.yanlun import STANDARD_WHITE, STANDART_BLACK, yanlun_texts
|
||||||
|
|
||||||
WHITE = (242, 244, 246) # F2F4F6
|
WHITE = wx.Colour(242, 244, 246) # F2F4F6
|
||||||
# WHITE2 = (248, 252, 255)
|
# WHITE2 = (248, 252, 255)
|
||||||
# WHITE3 = (233, 236, 240)
|
# WHITE3 = (233, 236, 240)
|
||||||
BLACK = (18, 17, 16) # 121110
|
BLACK = wx.Colour(18, 17, 16) # 121110
|
||||||
# BLACK2 = (9, 12, 14)
|
# BLACK2 = (9, 12, 14)
|
||||||
# BLACK3 = (0, 2, 6)
|
# BLACK3 = (0, 2, 6)
|
||||||
|
|
||||||
@@ -74,12 +74,16 @@ BLACK = (18, 17, 16) # 121110
|
|||||||
# BLACK = (242, 244, 246) # 121110
|
# BLACK = (242, 244, 246) # 121110
|
||||||
# BLACK2 = (248, 252, 255)
|
# BLACK2 = (248, 252, 255)
|
||||||
|
|
||||||
|
yanlun_fg_colour = wx.Colour(*STANDARD_WHITE)
|
||||||
|
yanlun_bg_colour = wx.Colour(*STANDART_BLACK)
|
||||||
|
|
||||||
__appname__ = "伶伦转换器"
|
__appname__ = "伶伦转换器"
|
||||||
__version__ = "WXGUI 1.2.1"
|
__version__ = "WXGUI 1.2.2"
|
||||||
__zhver__ = "WX图形界面 初代次版一编"
|
__zhver__ = "WX图形界面 初代次版二编"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
logger.info("检查更新")
|
logger.info("检查更新")
|
||||||
|
|
||||||
down_paths = check_update_release(
|
down_paths = check_update_release(
|
||||||
@@ -278,6 +282,7 @@ if down_paths:
|
|||||||
) = msct_plugin_function
|
) = msct_plugin_function
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
logger.info("注册变量并读取内容……")
|
logger.info("注册变量并读取内容……")
|
||||||
|
|
||||||
|
|
||||||
@@ -343,6 +348,10 @@ logger.printing = not osc.is_release
|
|||||||
|
|
||||||
yanlun_length = len(yanlun_texts)
|
yanlun_length = len(yanlun_texts)
|
||||||
|
|
||||||
|
|
||||||
|
logger.info("音·创内核版本:{}".format(Musicreater.__version__), mandatory_use=True)
|
||||||
|
|
||||||
|
|
||||||
logger.info("加载窗口布局……")
|
logger.info("加载窗口布局……")
|
||||||
|
|
||||||
|
|
||||||
@@ -1354,13 +1363,13 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def onSpeedSpinChanged(self, event):
|
def onSpeedSpinChanged(self, event):
|
||||||
if self.m_speed_spinCtrlDouble.Value > 1:
|
if self.m_speed_spinCtrlDouble.GetValue() > 1:
|
||||||
self.m_speed_slider.SetValue(
|
self.m_speed_slider.SetValue(
|
||||||
int((self.m_speed_spinCtrlDouble.Value + 8) * 50 / 9)
|
int((self.m_speed_spinCtrlDouble.GetValue() + 8) * 50 / 9)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.m_speed_slider.SetValue(
|
self.m_speed_slider.SetValue(
|
||||||
int((self.m_speed_spinCtrlDouble.Value - 0.01) * 5000 / 99)
|
int((self.m_speed_spinCtrlDouble.GetValue() - 0.01) * 5000 / 99)
|
||||||
)
|
)
|
||||||
|
|
||||||
def onProgressbarChecked(self, event):
|
def onProgressbarChecked(self, event):
|
||||||
@@ -1430,6 +1439,7 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
mid_cvt = ConvertClass[0].from_midi_file(
|
mid_cvt = ConvertClass[0].from_midi_file(
|
||||||
midi_file_path=file_name,
|
midi_file_path=file_name,
|
||||||
mismatch_error_ignorance=ignore_midi_mismatch_error,
|
mismatch_error_ignorance=ignore_midi_mismatch_error,
|
||||||
|
play_speed=self.m_speed_spinCtrlDouble.GetValue(),
|
||||||
pitched_note_table=convert_tables["PITCHED"][
|
pitched_note_table=convert_tables["PITCHED"][
|
||||||
convert_table_selection["PITCHED"]
|
convert_table_selection["PITCHED"]
|
||||||
],
|
],
|
||||||
@@ -1437,6 +1447,8 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
convert_table_selection["PERCUSSION"]
|
convert_table_selection["PERCUSSION"]
|
||||||
],
|
],
|
||||||
old_exe_format=self.m_oldExeFormatChecker_checkBox3.GetValue(),
|
old_exe_format=self.m_oldExeFormatChecker_checkBox3.GetValue(),
|
||||||
|
min_volume=self.m_volumn_spinCtrlDouble1.GetValue() / 100,
|
||||||
|
music_pitch_deviation=0,
|
||||||
)
|
)
|
||||||
|
|
||||||
cvt_dist = (
|
cvt_dist = (
|
||||||
@@ -1525,7 +1537,7 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
size,
|
size,
|
||||||
total_delay,
|
total_delay,
|
||||||
(
|
(
|
||||||
"\n指令数量:{}".format(cmd_num)
|
"\n指令数量:{}".format(cmd_num) # type: ignore
|
||||||
if self.m_playerChoice_choice2.GetSelection() == 0
|
if self.m_playerChoice_choice2.GetSelection() == 0
|
||||||
else ""
|
else ""
|
||||||
),
|
),
|
||||||
@@ -2169,7 +2181,12 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
app = LinglunConverterApp()
|
app = LinglunConverterApp()
|
||||||
|
|
||||||
|
try:
|
||||||
app.MainLoop()
|
app.MainLoop()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"程序异常退出:{e}")
|
||||||
|
|
||||||
|
logger.info("关闭窗口,收尾任务")
|
||||||
|
|
||||||
if on_exit_saving:
|
if on_exit_saving:
|
||||||
enpack_llc_pack(
|
enpack_llc_pack(
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
pyinstaller -D ./llc_win_wxPython.py -i ./resources/LLC_LOGO_OK_PLAIN_BANNER.ico --hide-console minimize-late --clean -n 伶伦转换器
|
pyinstaller -D ./llc_win_wxPython.py -i ./resources/LLC_LOGO_OK_PLAIN_BANNER.ico --hide-console minimize-late --clean -n 伶伦转换器
|
||||||
|
pause
|
||||||
|
python ./clean_pycache.py
|
||||||
5
requirements_cli.txt
Normal file
5
requirements_cli.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
setuptools < 80
|
||||||
|
Musicreater[full]>=2.1.0.1
|
||||||
|
TrimLog>=0.8.3
|
||||||
|
requests>=2.0.0
|
||||||
|
zhDateTime>=2.0.0
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
**金羿ELS**、**金羿**、**Eilles Wan**、**丌幂**、**诸葛亮与八卦阵**、**诸葛八卦**、**BgArray**、**鸣凤鸽子**、**鱼旧梦**、**ElapsingDreams**等一众具有显著特征的自然人网名、自然人姓名、自然人专有名称之类之辞皆为专有标记,未经其本人允许不得擅自使用。
|
**金羿ELS**、**金羿**、**Eilles Wan**、**丌幂**、**诸葛亮与八卦阵**、**诸葛八卦**、**BgArray**、**鸣凤鸽子**、**鱼旧梦**、**ElapsingDreams**等一众具有显著特征的自然人网名、自然人姓名、自然人专有名称之类之辞皆为专有标记,未经其本人允许不得擅自使用。
|
||||||
|
|
||||||
**伶伦工作站**、**伶伦转换器**、**LingLun Studio**、**LingLun Converter**、**音·创**、**Musicreater**等一众项目、软件、需求库之名称皆为专用之商业标记,未经其所有者允许不得擅自使用。
|
**伶伦工作站**、**伶伦转换器**、**LingLun Studio**、**LingLun Converter**、**音·创**、**Musicreater**等一众项目、软件、需求库之名称皆为本项目专用之商业标记,未经其所有者允许不得擅自使用。
|
||||||
|
|
||||||
睿乐组织的徽标[**【木制展框上的惊异媒体】(睿思乐发)**](https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/resources/TriMO_Theme.mp4)之图案及相关动画是**丌幂**所作的、**睿乐组织**的共同标志,其著作权归属**丌幂**所有,并授权给**睿乐组织**使用。其相关声像信息、睿乐组织的主题音[**【悦搏音符之回响】(睿思乐发)**](https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/resources/TriMO_Theme.mp4)是**诸葛亮与八卦阵**所制作的、**睿乐组织**的共同标记,其著作权归属**诸葛亮与八卦阵**所有,并授权给**睿乐组织**使用。上述之图形、动画、声音等相关媒体信息皆为**睿乐组织**所专用的商业标记,未经**睿乐组织**之允许不得使用。
|
睿乐组织的徽标[**【木制展框上的惊异媒体】(睿思乐发)**](./TriMO_Theme.mp4)之图案及相关动画是**丌幂**所作的、**睿乐组织**的共同标志,其著作权归属**丌幂**所有,并授权给**睿乐组织**使用。其相关声像信息、睿乐组织的主题音[**【悦搏音符之回响】(睿思乐发)**](./TriMO_Theme.mp4)是**诸葛亮与八卦阵**所制作的、**睿乐组织**的共同标记,其著作权归属**诸葛亮与八卦阵**所有,并授权给**睿乐组织**使用。上述之图形、动画、声音等相关媒体信息皆为**睿乐组织**所专用的商业标记,未经**睿乐组织**之允许不得使用。
|
||||||
|
|
||||||
[**木制框架中的乐灵**](https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/resources/LLC_LOGO_OK_PLAIN_BANNER.png)之图案及相关动画、声音均为**伶伦工作站**之专用标记,未经**睿乐组织**之允许不得使用。
|
[**木制框架中的乐灵**](./LLC_LOGO_OK_PLAIN_BANNER.png)之图案及相关动画、声音均为**伶伦工作站**之专用标记,未经**睿乐组织**之允许不得使用。
|
||||||
|
|
||||||
[**瓷板上的方块音符**](https://gitee.com/TriM-Organization/Musicreater/raw/master/resources/msctIcon.png)之图案及相关动画、声音均为**音·创库**之专用标记,未经**睿乐组织**之允许不得使用。
|
[**瓷板上的方块音符**](https://gitee.com/TriM-Organization/Musicreater/raw/master/resources/msctIcon.png)之图案及相关动画、声音均为**音·创库**之专用标记,未经**睿乐组织**之允许不得使用。
|
||||||
|
|
||||||
@@ -26,4 +26,4 @@
|
|||||||
不允许脱离于本项目而独立存在
|
不允许脱离于本项目而独立存在
|
||||||
不得随任何其他非本项目之内的软件连带发布
|
不得随任何其他非本项目之内的软件连带发布
|
||||||
不得用于商业用途
|
不得用于商业用途
|
||||||
若本项目之源码被用于商业用途,应当将其从中剔除
|
若本项目之源码被用于商业用途,除必要出现的显示外,应当将上述资源从中剔除
|
||||||
2
run_cli.sh
Normal file
2
run_cli.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
source ./.venv/bin/activate
|
||||||
|
python ./llc_cli.py
|
||||||
@@ -130,7 +130,7 @@ class LingLunAuthorPageFrame(wx.Frame):
|
|||||||
self.m_bitmap1 = wx.StaticBitmap(
|
self.m_bitmap1 = wx.StaticBitmap(
|
||||||
self.eilles_pannel,
|
self.eilles_pannel,
|
||||||
wx.ID_ANY,
|
wx.ID_ANY,
|
||||||
wx.Bitmap(eilles_pic, wx.BITMAP_TYPE_ANY),
|
wx.BitmapBundle(wx.Image(eilles_pic, wx.BITMAP_TYPE_ANY)),
|
||||||
wx.DefaultPosition,
|
wx.DefaultPosition,
|
||||||
wx.DefaultSize,
|
wx.DefaultSize,
|
||||||
0,
|
0,
|
||||||
@@ -183,7 +183,7 @@ class LingLunAuthorPageFrame(wx.Frame):
|
|||||||
|
|
||||||
bSizer41 = wx.BoxSizer(wx.VERTICAL)
|
bSizer41 = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
|
||||||
bSizer41.Add((0, 0), 1, wx.EXPAND, 5)
|
bSizer41.Add(wx.Size(0, 0), 1, wx.EXPAND, 5)
|
||||||
|
|
||||||
self.m_staticText211 = wx.StaticText(
|
self.m_staticText211 = wx.StaticText(
|
||||||
self.bgarray_pannel,
|
self.bgarray_pannel,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ def unpack_llc_pack(from_dist: str, raise_error: bool = True):
|
|||||||
== hashlib.pbkdf2_hmac(
|
== hashlib.pbkdf2_hmac(
|
||||||
"sha256",
|
"sha256",
|
||||||
md5_value + packed_bytes,
|
md5_value + packed_bytes,
|
||||||
salt(hashlib.sha256(brotli.__version__)),
|
salt(hashlib.sha256(str(brotli.__version__).encode("gb18030"))),
|
||||||
16,
|
16,
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ def check_update_release(
|
|||||||
version_renew_tip.format(
|
version_renew_tip.format(
|
||||||
app=appname, latest=version_content, current=version_now
|
app=appname, latest=version_content, current=version_now
|
||||||
),
|
),
|
||||||
code_content["release"]["release"]["description"],
|
code_content["release"]["release"]["description"].replace("\r\n", "\n"),
|
||||||
):
|
):
|
||||||
return dict(
|
return dict(
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class HTMLFrame(wx.Frame):
|
|||||||
tip_text,
|
tip_text,
|
||||||
web_text,
|
web_text,
|
||||||
window_title: str = "新版本已发布",
|
window_title: str = "新版本已发布",
|
||||||
bg_colour: tuple = (0, 0, 0),
|
bg_colour: tuple | wx.Colour = (0, 0, 0),
|
||||||
window_size: tuple = (800, 480),
|
window_size: tuple = (800, 480),
|
||||||
):
|
):
|
||||||
"""构造函数"""
|
"""构造函数"""
|
||||||
@@ -36,12 +36,12 @@ class HTMLFrame(wx.Frame):
|
|||||||
id=wx.ID_ANY,
|
id=wx.ID_ANY,
|
||||||
title=window_title,
|
title=window_title,
|
||||||
pos=wx.DefaultPosition,
|
pos=wx.DefaultPosition,
|
||||||
size=window_size,
|
size=wx.Size(*window_size),
|
||||||
style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL,
|
style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL,
|
||||||
)
|
)
|
||||||
|
|
||||||
# self.SetIcon(wx.Icon('', wx.BITMAP_TYPE_ICO))
|
# self.SetIcon(wx.Icon('', wx.BITMAP_TYPE_ICO))
|
||||||
self.SetBackgroundColour(bg_colour)
|
self.SetBackgroundColour(wx.Colour(bg_colour))
|
||||||
self.Center()
|
self.Center()
|
||||||
|
|
||||||
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
|
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ from .io import logger, prt
|
|||||||
STANDARD_WHITE = (242, 244, 246)
|
STANDARD_WHITE = (242, 244, 246)
|
||||||
STANDART_BLACK = (18, 17, 16)
|
STANDART_BLACK = (18, 17, 16)
|
||||||
|
|
||||||
yanlun_fg_colour = STANDARD_WHITE
|
|
||||||
yanlun_bg_colour = STANDART_BLACK
|
|
||||||
|
|
||||||
logger.info("获取 言·论 信息……")
|
logger.info("获取 言·论 信息……")
|
||||||
|
|
||||||
@@ -43,7 +41,7 @@ else:
|
|||||||
try:
|
try:
|
||||||
yanlun_texts = (
|
yanlun_texts = (
|
||||||
requests.get(
|
requests.get(
|
||||||
"https://nd.liteyuki.icu/api/v3/share/content/Xpue?path=null",
|
"https://nd.liteyuki.org/api/v3/share/content/Xpue?path=null",
|
||||||
)
|
)
|
||||||
.text.strip("\n")
|
.text.strip("\n")
|
||||||
.split("\n")
|
.split("\n")
|
||||||
@@ -55,3 +53,5 @@ else:
|
|||||||
except BaseException as E:
|
except BaseException as E:
|
||||||
logger.warning(f"读取言·论信息发生 未知 错误:\n{E}")
|
logger.warning(f"读取言·论信息发生 未知 错误:\n{E}")
|
||||||
yanlun_texts = ["灵光焕发 深艺献心"]
|
yanlun_texts = ["灵光焕发 深艺献心"]
|
||||||
|
|
||||||
|
logger.info("已获取言·论 {} 条".format(len(yanlun_texts)))
|
||||||
|
|||||||
Reference in New Issue
Block a user