mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2025-06-03 02:35:24 +00:00
更新依赖、窗口内支持mcstructure、协议更新、命令行docker构建
This commit is contained in:
parent
59f5615a80
commit
e3b94f7445
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
FROM docker.1ms.run/library/python:3.10-slim-bullseye
|
||||
|
||||
ENV TZ Asia/Taipei
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
RUN touch /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 https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
|
||||
echo "deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
|
||||
echo "deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
|
||||
echo "deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
|
||||
echo "deb 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
|
||||
|
||||
|
||||
RUN apt-get update && apt-get install -y git && \
|
||||
# 清理 apt 缓存
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 克隆指定的 git 仓库
|
||||
RUN git clone https://gitee.com/TriM-Organization/Linglun-Converter.git
|
||||
|
||||
# 创建 Python 虚拟环境
|
||||
RUN python3 -m venv /app/venv
|
||||
|
||||
|
||||
RUN . /app/venv/bin/activate && \
|
||||
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
||||
/app/venv/bin/python3 -m pip install --upgrade pip && \
|
||||
pip install --no-cache-dir --upgrade "Musicreater[full]" TrimLog requests zhDateTime
|
||||
|
||||
# 切换到克隆下来的仓库目录
|
||||
WORKDIR /app/Linglun-Converter
|
||||
|
||||
# 设置容器启动时执行的默认命令,使用虚拟环境中的 python
|
||||
CMD ["/app/venv/bin/python3", "llc_cli.py"]
|
22
LICENSE.md
22
LICENSE.md
@ -1,8 +1,8 @@
|
||||
<h1 align="center"><b><i>在 Gitee Push #4791dcd(不含)之后本仓库使用</i>《汉钰律许可协议 第一版》<i>开源</i></b></h1>
|
||||
<h1 align="center"><b><i>在 Gitee Push #4791dcd(不含)之后本仓库使用</i>《汉钰律许可协议,第一版》<i>授权开源</i></b></h1>
|
||||
|
||||
# 汉钰律许可协议
|
||||
# 汉钰律许可协议,第一版
|
||||
|
||||
**总第一版 · 二〇二四年七月七日编**
|
||||
**总第一版 第二次修订 · 二〇二四年七月七日编 二〇二五年四月二十六日修订**
|
||||
|
||||
## 一、重要须知
|
||||
|
||||
@ -14,13 +14,13 @@
|
||||
|
||||
4. 由于互联网服务、互联网内容的特殊性,若本协议以电子协议形式分发并签订,其依然有效。您一旦开始对本协议所授权之作品进行本协议所授权的行为,即视为您已经阅读、理解并同意并已经接受本协议的全部条款。
|
||||
|
||||
5. 本协议的订立、履行、解释及争议的解决均**适用中华人民共和国法律并排除其他一切冲突法的适用**。_本协议订立于许可证最初的颁发者的地址。若其为自然人,则订立于该自然人户籍所在地;若为法人或非法人组织,则订立于其注册地_。本协议的订立各方应友好协商解决于协议所规定之行为的履行相关的争议;如协商不成,任何一方均可向合同签订地有管辖权的人民法院提起诉讼。
|
||||
5. 本协议的订立、履行、解释及争议的解决均**适用中华人民共和国法律并排除其他一切冲突法的适用**。_本协议订立于许可证最初的颁发者的地址。若颁发者为自然人,则订立于该自然人户籍所在地;若为法人或非法人组织,则订立于其注册地_。本协议的订立各方应友好协商解决于协议所规定之行为的履行相关的争议;如协商不成,任何一方均可向合同签订地有管辖权的人民法院提起诉讼。
|
||||
|
||||
6. 本协议的原本仅为现代汉语,书写于简体中文。若存在其他语言的翻译或其他同等语言但非简体中文文本的版本,应当无法律效力。
|
||||
|
||||
## 二、术语定义
|
||||
|
||||
1. “**许可证**”、“**协议**”(后文称“本协议”)是指根据本文档中所列举的全部术语、定义、条款、限制等文本,是本合同的简称称谓。本合同全称是“汉钰律许可协议”。
|
||||
1. “**许可证**”、“**协议**”(后文称“本协议”)是指根据本文档中所列举的全部术语、定义、条款、限制等文本,是本合同的简称称谓。本合同全称是 **“汉钰律许可协议,第一版”**。
|
||||
|
||||
2. “**协议颁发者**”(后文称“颁发者”)是将条款或协议应用于其拥有著作财产权的作品的民事主体,或由其指定从而拥有颁发者身份的民事主体。
|
||||
|
||||
@ -30,13 +30,13 @@
|
||||
|
||||
5. “**采用本协议的作品**”(后文称“此作品”)是指经颁发者授权而使用本协议进行授权的任何作品,该作品应在自然人可见处明确附加一个自然人可读的版权通知(可以参考文末附录中提供的示例);若在一个可分割的作品中,部分地采用本协议进行授权,则该部分应当视为一个独立的采用本协议的作品,该作品应当在自然人可见处明确附加一个自然人可读的范围限定和版权通知(同样可以参考文末附录中提供的示例)。
|
||||
|
||||
6. “**贡献**”是指对作品进行的,意在提交给此作品颁发者以让著作权人包含在其作品中的任何修订或补充,该修订或补充同样属于一种作品。依据此定义,“提交”一词表示经由此作品颁发者所指定的形式,将其所进行的修改发送给此作品颁发者。该形式应当包括在此作品颁发者指定的平台内发送易于编辑的修改信息、在此作品颁发者指定的电子邮箱中发送易于编辑的修改信息、在此作品颁发者指定的源码控制系统或发布跟踪系统上提交的易于编辑的修改信息,但由著作权人以明显标注或指定为“非贡献”的活动除外。颁发者自己对作品进行的修改同样视作对作品的贡献。
|
||||
6. “**贡献**”是指对作品进行的,意在提交给此作品颁发者以让著作权人包含在其作品中的任何修订或补充,该修订或补充同样属于一种作品。依据此定义,**“提交”**一词表示经由此作品颁发者所指定的形式,将其所进行的修改发送给此作品颁发者。该形式应当包括在此作品颁发者指定的平台内发送易于编辑的修改信息、在此作品颁发者指定的电子邮箱中发送易于编辑的修改信息、在此作品颁发者指定的源码控制系统或发布跟踪系统上提交的易于编辑的修改信息,但由著作权人以明显标注或指定为“非贡献”的活动除外。颁发者自己对作品进行的修改同样视作对作品的贡献。
|
||||
|
||||
7. “**贡献者**”是指此作品颁发者接受的贡献的提交者,或包含在作品的贡献清单中的民事主体。贡献者在提交贡献并经此作品颁发者通过且该贡献已经被应用于此作品中后,该贡献者应当视为此作品的著作权人之一,但不应视为此作品非其贡献的部分的著作权人。一个作品的颁发者同样属于其贡献者。**请注意**,针对贡献者提交的贡献,该贡献者应被视为该贡献的协议颁发者,但不应视作本作品的颁发者。
|
||||
|
||||
8. “**用户**”、“**使用者**”是指行使本协议所授权之行为的民事主体。据此,贡献者亦属于用户。
|
||||
|
||||
9. “**商业性使用**”、“**商用**”是指任何以谋取利益为目的的使用,包括但不限于以贩卖、出租的形式对作品进行使用;但若将该牟利活动明确指示为“捐赠”,且在牟利者进行本协议所授权的活动时不以捐赠数额为标准,则此种的获取利益的“捐赠”行为不属于商业性使用。
|
||||
9. “**商业性使用**”、“**商用**”是指任何以谋取利益为目的的使用,包括但不限于以贩卖、出租的形式对作品进行使用;但若将该获取利益之活动明确指示为“捐赠”,且在获利者在进行本协议所授权的活动时不以捐赠数额为标准而区别之,则此种的获取利益的“捐赠”行为不属于商业性使用。
|
||||
|
||||
## 三、权利授予
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
|
||||
该通知的内容仅供信息提供,不应对许可证进行任何文字上的修改。用户可在其分发的作品中,在不构成修改本协议的前提下,在作品自身的声明通知或属性描述后或作为附录添加。
|
||||
|
||||
6. 依据本款第 3 条,若用户二次分发此作品时,选择向作品的接收者提供收费的担保服务,则必须明确告知该接收者本协议全部内容与此作品原出处,并确保其知悉上述内容;但若用户在二次分发此作品是,不选择提供任何服务,则该用户不允许向作品的接收者收取任何费用,除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
|
||||
6. 依据本款第3条,若用户二次分发此作品时,选择向作品的接收者提供收费的担保服务,则必须明确告知该接收者本协议全部内容与此作品原出处,并确保其知悉上述内容;但若用户在二次分发此作品时,不选择提供任何服务,则该用户不允许向作品的接收者收取任何费用,除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
|
||||
|
||||
## 五、提交贡献
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
|
||||
## 七、免责声明
|
||||
|
||||
1. 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,**不予提供任何形式的担保、任何明示、任何暗示或类似承诺**,此类包括但不限于担保此作品毫无缺陷、担保此作品适于贩卖、担保此作品适于特定目的、担保使用此作品绝不侵权。用户将自行承担因此作品的质量或性能问题而产生的全部风险。若此作品在任何方面欠妥,将由用户(而非任何贡献者、而非任何颁发者)承担所有必要的服务、维修或除错的任何成本。本免责声明本许可的重要组成部分。当且仅当遵守本免责声明时,本协议的其他条款中对本作品的使用授权方可生效。
|
||||
1. 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,**不予提供任何形式的担保、任何明示、任何暗示或类似承诺**,此类包括但不限于担保此作品毫无缺陷、担保此作品适于贩卖、担保此作品适于特定目的、担保使用此作品绝不侵权。用户将自行承担因此作品的质量或性能问题而产生的全部风险。若此作品在任何方面欠妥,将由用户(而非任何贡献者、而非任何颁发者)承担所有必要的服务、维修或除错的任何成本。本免责声明是本许可的重要组成部分。当且仅当遵守本免责声明时,本协议的其他条款中对本作品的使用授权方可生效。
|
||||
|
||||
2. 无论是因何种原因,如果不是在法律规定的特殊情况(如,确为贡献者的故意或重大过失)下或者经过了特殊准许,即使贡献者事先已知发生损害的可能,在使用本作品时,用户产生的任何直接、间接、特殊、偶然或必然造成的损失(包括但不限于商誉损失、工作延误、计算机系统故障等),**均不由任一贡献者承担**。
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
版权所有 © 〔年份〕 〔著作权人〕
|
||||
〔或者:版权所有 (C) 〔年份〕 〔著作权人〕〕
|
||||
|
||||
〔该作品〕根据 第一版 汉钰律许可协议(“本协议”)授权。
|
||||
〔该作品〕根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||
任何人皆可从以下地址获得本协议副本:〔本协议副本所在地址〕。
|
||||
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||
详细的准许和限制条款请见原协议文本。
|
||||
@ -330,7 +330,7 @@
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
Copyright © 2024 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
|
||||
Copyright © 2025 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -45,6 +45,10 @@
|
||||
|
||||
## 致谢 🙏
|
||||
|
||||
- 感谢由 **𝘼𝙪𝙤 “可白”**\<QQ2425476216\> 带来的 Dockerfile 文件参考;
|
||||
在此特别授予其利用本软件进行商业使用之权利:
|
||||
特别声明:依据《汉钰律许可协议,第一版》,准许**可白**\<QQ2425476216\>在中国大陆范围内非专有地对本作品进行商业性使用,包括但不限于:出售本作品之副本、将本作品嵌入云平台后租赁等。
|
||||
|
||||
> 感谢广大群友为此软件提供的测试和建议
|
||||
|
||||
## 联系 📞
|
||||
@ -56,8 +60,8 @@ QQ 群 [861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
|
||||
[Bilibili: 金羿ELS]: https://img.shields.io/badge/Bilibili-%E9%87%91%E7%BE%BFELS-00A1E7?style=for-the-badge
|
||||
[Bilibili: 诸葛亮与八卦阵]: https://img.shields.io/badge/Bilibili-%E8%AF%B8%E8%91%9B%E4%BA%AE%E4%B8%8E%E5%85%AB%E5%8D%A6%E9%98%B5-00A1E7?style=for-the-badge
|
||||
[CodeStyle: black]: https://img.shields.io/badge/code%20style-black-121110.svg?style=for-the-badge
|
||||
[python]: https://img.shields.io/badge/python-3.6-AB70FF?style=for-the-badge
|
||||
[python]: https://img.shields.io/badge/python-3.8-AB70FF?style=for-the-badge
|
||||
|
||||
<!-- [release]: https://img.shields.io//TriM-Organization/Linglun-Converter?style=for-the-badge -->
|
||||
|
||||
[license]: https://img.shields.io/badge/Licence-Apache-228B22?style=for-the-badge
|
||||
[license]: https://img.shields.io/badge/Licence-%E6%B1%89%E9%92%B0%E5%BE%8B%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE-228B22?style=for-the-badge
|
||||
|
@ -101,8 +101,7 @@
|
||||
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
|
||||
# 然后安装(依次执行下面的指令)
|
||||
apt-get install python-numpy
|
||||
pip install brotli TrimMCStruct
|
||||
pip install Musicreater TrimLog
|
||||
pip install Musicreater[full] TrimLog
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
```
|
||||
|
||||
@ -119,8 +118,7 @@
|
||||
之后再来安装即可
|
||||
|
||||
```bash
|
||||
pip install brotli TrimMCStruct
|
||||
pip install Musicreater TrimLog
|
||||
pip install Musicreater[full] TrimLog
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
```
|
||||
|
||||
@ -133,7 +131,7 @@
|
||||
既然已经有了运行环境,那么我们就需要下载一个用来下载我们的**伶伦转换器**的工具,我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器,这个世界上你也找不到第二个,所以我们来安装一下:
|
||||
|
||||
```bash
|
||||
pkg install git
|
||||
apt install git
|
||||
```
|
||||
|
||||
安装完成后记得测试一下:
|
||||
@ -148,7 +146,7 @@ pkg install git
|
||||
git clone https://gitee.com/TriM-Organization/Linglun-Converter.git llc
|
||||
```
|
||||
|
||||
当上述命令执行成功,你会在执行此命令的所在位置发现一个名为 `llc` 的文件夹,其中包含的正是我们心心念念下载的本程序源代码。
|
||||
当上述命令执行成功,你会在执行此命令的所在位置发现一个名为 `llc` 的文件夹,其中包含的正是我们心心念念下载的本程序源代码。
|
||||
本程序可以直接从源代码运行,因此,赶快进入下载到的文件夹:
|
||||
|
||||
```bash
|
||||
|
@ -69,9 +69,7 @@
|
||||
2. 确认完成之后,我们来安装一下依赖库:
|
||||
|
||||
```bash
|
||||
pip install mido -i https://mirrors.aliyun.com/pypi/simple/
|
||||
pip install brotli -i https://mirrors.aliyun.com/pypi/simple/
|
||||
pip install Musicreater -i https://mirrors.aliyun.com/pypi/simple/
|
||||
pip install Musicreater[full] -i https://mirrors.aliyun.com/pypi/simple/
|
||||
pip install TrimLog -i https://mirrors.aliyun.com/pypi/simple/
|
||||
```
|
||||
|
||||
|
25
llc_cli.py
25
llc_cli.py
@ -7,26 +7,24 @@
|
||||
伶伦转换器 命令行
|
||||
Linglun Converter CLI
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
伶伦转换器命令行版本(“本项目”)的协议颁发者为 金羿
|
||||
The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan.
|
||||
|
||||
本项目根据 第一版 汉钰律许可协议(“本协议”)授权。
|
||||
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||
详细的准许和限制条款请见原协议文本。
|
||||
"""
|
||||
|
||||
__version__ = "0.0.8"
|
||||
__version__ = "0.0.9"
|
||||
|
||||
|
||||
import os
|
||||
import random
|
||||
|
||||
# import sys
|
||||
|
||||
import Musicreater
|
||||
from Musicreater import DEFAULT_PROGRESSBAR_STYLE
|
||||
from Musicreater.plugin.addonpack import (
|
||||
@ -34,15 +32,19 @@ from Musicreater.plugin.addonpack import (
|
||||
to_addon_pack_in_repeater,
|
||||
to_addon_pack_in_score,
|
||||
)
|
||||
|
||||
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
||||
from Musicreater.plugin.mcstructfile import (
|
||||
to_mcstructure_file_in_delay,
|
||||
to_mcstructure_file_in_repeater,
|
||||
to_mcstructure_file_in_score,
|
||||
)
|
||||
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
||||
from utils.io import logger, int_str, prt, ipt, isin, bool_str, float_str
|
||||
from utils.yanlun import yanlun_texts, solar_date
|
||||
|
||||
from utils.io import bool_str, float_str, int_str, ipt, isin, logger, prt
|
||||
from utils.yanlun import solar_date, yanlun_texts
|
||||
|
||||
# import sys
|
||||
|
||||
|
||||
|
||||
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
||||
|
||||
@ -204,7 +206,7 @@ def is_in_player(sth: str, in_ok: tuple = (0, 1, 2)):
|
||||
|
||||
|
||||
output_file_format = format_ipt(
|
||||
"输出文件类型 (mcpack/0|bdx/1|mcstructure/2)",
|
||||
"输出文件类型 (mcpack/0|bdx/1|mcstructure/2):",
|
||||
is_in_bdx_mcpack,
|
||||
"输入内容有误,请重新输入。",
|
||||
)[1]
|
||||
@ -348,6 +350,7 @@ if output_file_format == 0:
|
||||
cvt_method = to_addon_pack_in_delay
|
||||
elif player_format == 2:
|
||||
cvt_method = to_addon_pack_in_repeater
|
||||
|
||||
elif output_file_format == 2:
|
||||
if player_format == 1:
|
||||
cvt_method = to_mcstructure_file_in_score
|
||||
|
@ -7,13 +7,13 @@
|
||||
伶伦转换器暨模组特用奇巧
|
||||
Linglun Converter for Special Use with addons
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
伶伦转换器暨模组特用奇巧版本(“本项目”)的协议颁发者为 金羿
|
||||
The Licensor of _Linglun Converter for Special Use with addons_("this project") is Eilles Wan.
|
||||
|
||||
本项目根据 第一版 汉钰律许可协议(“本协议”)授权。
|
||||
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||
详细的准许和限制条款请见原协议文本。
|
||||
|
@ -4,13 +4,13 @@
|
||||
伶伦转换器 WXGUI
|
||||
Linglun Converter WxPython GUI
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
伶伦转换器WXGUI版本(“本项目”)的协议颁发者为 金羿
|
||||
The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan.
|
||||
|
||||
本项目根据 第一版 汉钰律许可协议(“本协议”)授权。
|
||||
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||
详细的准许和限制条款请见原协议文本。
|
||||
@ -21,7 +21,6 @@ The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan.
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
|
||||
import threading
|
||||
|
||||
# from types import ModuleType
|
||||
@ -40,25 +39,28 @@ if sys.argv:
|
||||
import Musicreater
|
||||
import Musicreater.experiment as Musicreater_experiment
|
||||
import Musicreater.plugin
|
||||
import wx
|
||||
import wx.propgrid as pg
|
||||
import wx.xrc
|
||||
from Musicreater.plugin.addonpack import (
|
||||
to_addon_pack_in_delay,
|
||||
to_addon_pack_in_repeater,
|
||||
to_addon_pack_in_score,
|
||||
)
|
||||
from Musicreater.plugin.websocket import to_websocket_server
|
||||
from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_score
|
||||
from Musicreater.plugin.mcstructfile import (
|
||||
to_mcstructure_file_in_delay,
|
||||
to_mcstructure_file_in_repeater,
|
||||
to_mcstructure_file_in_score,
|
||||
)
|
||||
from Musicreater.plugin.websocket import to_websocket_server
|
||||
|
||||
import wx
|
||||
import wx.xrc
|
||||
import wx.propgrid as pg
|
||||
|
||||
from utils.io import logger, object_constants, log__init__, TrimLog
|
||||
from utils.yanlun import yanlun_texts, yanlun_fg_colour, yanlun_bg_colour
|
||||
from utils.authorp import go_author_page
|
||||
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.update_check import check_update_release
|
||||
from utils.packdata import enpack_llc_pack, unpack_llc_pack, load_msct_packed_data
|
||||
from utils.webview import go_update_tip
|
||||
|
||||
from utils.yanlun import yanlun_bg_colour, yanlun_fg_colour, yanlun_texts
|
||||
|
||||
WHITE = (242, 244, 246) # F2F4F6
|
||||
# WHITE2 = (248, 252, 255)
|
||||
@ -74,8 +76,8 @@ BLACK = (18, 17, 16) # 121110
|
||||
|
||||
|
||||
__appname__ = "伶伦转换器"
|
||||
__version__ = "WXGUI 1.2.0.2"
|
||||
__zhver__ = "WX图形界面 初代次版"
|
||||
__version__ = "WXGUI 1.2.1"
|
||||
__zhver__ = "WX图形界面 初代次版一编"
|
||||
|
||||
|
||||
logger.info("检查更新")
|
||||
@ -286,10 +288,14 @@ convert_tables = {
|
||||
"PITCHED": {
|
||||
"“偷吃”对照表": Musicreater.MM_TOUCH_PITCHED_INSTRUMENT_TABLE,
|
||||
"“经典”对照表": Musicreater.MM_CLASSIC_PITCHED_INSTRUMENT_TABLE,
|
||||
"“断联”对照表": Musicreater.MM_DISLINK_PITCHED_INSTRUMENT_TABLE,
|
||||
"“NBS”对照表": Musicreater.MM_NBS_PITCHED_INSTRUMENT_TABLE,
|
||||
},
|
||||
"PERCUSSION": {
|
||||
"“偷吃”对照表": Musicreater.MM_TOUCH_PERCUSSION_INSTRUMENT_TABLE,
|
||||
"“经典”对照表": Musicreater.MM_CLASSIC_PERCUSSION_INSTRUMENT_TABLE,
|
||||
"“断联”对照表": Musicreater.MM_DISLINK_PERCUSSION_INSTRUMENT_TABLE,
|
||||
"“NBS”对照表": Musicreater.MM_NBS_PERCUSSION_INSTRUMENT_TABLE,
|
||||
},
|
||||
}
|
||||
convert_table_selection = {
|
||||
@ -745,7 +751,7 @@ class ConvertPagePanel(wx.Panel):
|
||||
wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL
|
||||
)
|
||||
|
||||
m_outformatChoice_choice1Choices = ["附加包", "BDX结构"]
|
||||
m_outformatChoice_choice1Choices = ["附加包", "MCSTRUCTURE结构", "BDX结构"]
|
||||
self.m_outformatChoice_choice1 = wx.Choice(
|
||||
ss_outputFormatChooseSizer.GetStaticBox(),
|
||||
wx.ID_ANY,
|
||||
@ -774,7 +780,7 @@ class ConvertPagePanel(wx.Panel):
|
||||
m_playerChoice_choice2Choices,
|
||||
0,
|
||||
)
|
||||
self.m_playerChoice_choice2.SetSelection(2)
|
||||
self.m_playerChoice_choice2.SetSelection(1)
|
||||
ss_playerChooseSizer.Add(self.m_playerChoice_choice2, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5)
|
||||
@ -1271,17 +1277,30 @@ class ConvertPagePanel(wx.Panel):
|
||||
|
||||
def onOutputFormatChosen(self, event):
|
||||
# 0: 附加包
|
||||
# 1: BDX
|
||||
# 1: MCSTRUCTURE
|
||||
# 2: BDX
|
||||
# prt("选择中:",self.m_outformatChoice_choice1.GetSelection())
|
||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
|
||||
|
||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||
self.m_StructureHeight_slider7.Enable(False)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
||||
else:
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
elif self.m_outformatChoice_choice1.GetSelection() == 1:
|
||||
|
||||
if self.m_outformatChoice_choice1.GetSelection() == 1:
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
|
||||
|
||||
if self.m_playerChoice_choice2.GetSelection() == 2:
|
||||
self.m_StructureHeight_slider7.Enable(False)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
||||
else:
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
|
||||
elif self.m_outformatChoice_choice1.GetSelection() == 2:
|
||||
self.m_EnteringBDXfileSignName_textCtrl12.Enable(True)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
@ -1290,20 +1309,27 @@ class ConvertPagePanel(wx.Panel):
|
||||
# 0 计分板 1 延时 2中继器
|
||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||
self.m_PlayerSelectorEntering_comboBox1.Enable(False)
|
||||
self.m_StructureHeight_slider7.Enable(False)
|
||||
|
||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
||||
elif self.m_outformatChoice_choice1.GetSelection() == 1:
|
||||
self.m_StructureHeight_slider7.Enable(False)
|
||||
else:
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
|
||||
self.m_ScoreboardNameEntering_textCtrl9.Enable(True)
|
||||
self.m_IsAutoResetScoreboard_checkBox2.Enable(True)
|
||||
else:
|
||||
self.m_PlayerSelectorEntering_comboBox1.Enable(True)
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
if (self.m_outformatChoice_choice1.GetSelection() == 1) and (
|
||||
self.m_playerChoice_choice2.GetSelection() == 2
|
||||
):
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
||||
self.m_StructureHeight_slider7.Enable(False)
|
||||
else:
|
||||
self.m_StructureHeight_slider7.Enable(True)
|
||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||
|
||||
self.m_ScoreboardNameEntering_textCtrl9.Enable(False)
|
||||
self.m_IsAutoResetScoreboard_checkBox2.Enable(False)
|
||||
@ -1420,7 +1446,8 @@ class ConvertPagePanel(wx.Panel):
|
||||
)
|
||||
|
||||
# 0: 附加包
|
||||
# 1: BDX
|
||||
# 1: mcstructure
|
||||
# 2: BDX
|
||||
|
||||
# 0 计分板 1 延时 2中继器
|
||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||
@ -1463,6 +1490,50 @@ class ConvertPagePanel(wx.Panel):
|
||||
wx.YES_DEFAULT | wx.ICON_INFORMATION,
|
||||
).ShowModal()
|
||||
elif self.m_outformatChoice_choice1.GetSelection() == 1:
|
||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||
size, total_delay, cmd_num = to_mcstructure_file_in_score(
|
||||
midi_cvt=mid_cvt,
|
||||
dist_path=cvt_dist,
|
||||
scoreboard_name=self.m_ScoreboardNameEntering_textCtrl9.GetValue(),
|
||||
auto_reset=self.m_IsAutoResetScoreboard_checkBox2.GetValue(),
|
||||
max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(),
|
||||
)
|
||||
elif self.m_playerChoice_choice2.GetSelection() == 1:
|
||||
size, total_delay = to_mcstructure_file_in_delay(
|
||||
midi_cvt=mid_cvt,
|
||||
dist_path=cvt_dist,
|
||||
player=self.m_PlayerSelectorEntering_comboBox1.GetValue(),
|
||||
max_height=self.m_enteringStructureMaxHeight_spinCtrl1.GetValue(),
|
||||
)
|
||||
elif self.m_playerChoice_choice2.GetSelection() == 2:
|
||||
size, total_delay = to_mcstructure_file_in_repeater(
|
||||
midi_cvt=mid_cvt,
|
||||
dist_path=cvt_dist,
|
||||
player=self.m_PlayerSelectorEntering_comboBox1.GetValue(),
|
||||
)
|
||||
else:
|
||||
wx.MessageDialog(
|
||||
None,
|
||||
"你输入的播放器有误!",
|
||||
"错误",
|
||||
wx.YES_DEFAULT | wx.ICON_ERROR,
|
||||
).ShowModal()
|
||||
return
|
||||
wx.MessageDialog(
|
||||
None,
|
||||
"完成!\n结构大小:{}\n延迟总长:{}{}".format(
|
||||
size,
|
||||
total_delay,
|
||||
(
|
||||
"\n指令数量:{}".format(cmd_num)
|
||||
if self.m_playerChoice_choice2.GetSelection() == 0
|
||||
else ""
|
||||
),
|
||||
),
|
||||
"转换成功",
|
||||
wx.YES_DEFAULT | wx.ICON_INFORMATION,
|
||||
).ShowModal()
|
||||
elif self.m_outformatChoice_choice1.GetSelection() == 2:
|
||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||
cmd_num, total_delay, size, final_pos = to_BDX_file_in_score(
|
||||
midi_cvt=mid_cvt,
|
||||
@ -2034,7 +2105,7 @@ class SettingPagePannel(wx.Panel):
|
||||
)
|
||||
if "自定义对照表" not in self.m_pitched_instrument_table_choice.Items:
|
||||
self.m_pitched_instrument_table_choice.Append("自定义对照表")
|
||||
self.m_pitched_instrument_table_choice.SetSelection(2)
|
||||
self.m_pitched_instrument_table_choice.SetSelection(4)
|
||||
|
||||
def onPitchedInstTableChanging(self, event):
|
||||
event.Skip()
|
||||
@ -2083,7 +2154,7 @@ class SettingPagePannel(wx.Panel):
|
||||
)
|
||||
if "自定义对照表" not in self.m_percussion_instrument_table_choice1.Items:
|
||||
self.m_percussion_instrument_table_choice1.Append("自定义对照表")
|
||||
self.m_percussion_instrument_table_choice1.SetSelection(2)
|
||||
self.m_percussion_instrument_table_choice1.SetSelection(4)
|
||||
|
||||
def onPercussionInstTableChanging(self, event):
|
||||
event.Skip()
|
||||
|
@ -1,10 +1,7 @@
|
||||
Musicreater>=2.1.0.1
|
||||
Musicreater[full]>=2.1.0.1
|
||||
TrimLog>=0.8.3
|
||||
requests>=2.0.0
|
||||
TrimMCStruct>=1.0.0
|
||||
rich
|
||||
wxPython
|
||||
dill
|
||||
brotli
|
||||
fcwslib=3.0.1
|
||||
zhDateTime>=1.0.3
|
||||
# fcwslib=3.0.1
|
||||
zhDateTime>=2.0.0
|
||||
|
@ -4,8 +4,8 @@
|
||||
伶伦转换器 作者信息组件
|
||||
Linglun Converter Author Page Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
@ -13,9 +13,8 @@ Terms & Conditions: License.md in the root directory
|
||||
|
||||
|
||||
import wx
|
||||
import wx.xrc
|
||||
import wx.media
|
||||
|
||||
import wx.xrc
|
||||
|
||||
###########################################################################
|
||||
## Class LingLunAuthorPageFrame
|
||||
|
11
utils/io.py
11
utils/io.py
@ -4,8 +4,8 @@
|
||||
伶伦转换器 命令行组件
|
||||
Linglun Converter Command Line IO Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
@ -16,20 +16,19 @@ from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Sequence,
|
||||
Set,
|
||||
TextIO,
|
||||
Tuple,
|
||||
Iterable,
|
||||
Sequence,
|
||||
Union,
|
||||
)
|
||||
|
||||
import TrimLog
|
||||
from TrimLog import object_constants, logger, log__init__
|
||||
|
||||
from TrimLog import log__init__, logger, object_constants
|
||||
|
||||
logger.is_logging = True
|
||||
logger.suffix = ".llc"
|
||||
|
@ -4,15 +4,15 @@
|
||||
伶伦转换器 本地化组件
|
||||
Linglun Converter Language Localization Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
"""
|
||||
|
||||
|
||||
from .io import logger, Any
|
||||
from .io import Any, logger
|
||||
|
||||
|
||||
def _() -> str:
|
||||
|
@ -4,8 +4,8 @@
|
||||
伶伦转换器 打包存档组件
|
||||
Linglun Converter Data Package Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
@ -14,11 +14,11 @@ Terms & Conditions: License.md in the root directory
|
||||
|
||||
import hashlib
|
||||
|
||||
import dill
|
||||
import brotli
|
||||
import dill
|
||||
|
||||
from .salt import salt
|
||||
from .io import Any
|
||||
from .salt import salt
|
||||
|
||||
|
||||
def unpack_llc_pack(from_dist: str, raise_error: bool = True):
|
||||
@ -27,7 +27,12 @@ def unpack_llc_pack(from_dist: str, raise_error: bool = True):
|
||||
|
||||
if (md5_value == hashlib.md5(packed_bytes).digest()) and (
|
||||
salty_sha256_value
|
||||
== hashlib.pbkdf2_hmac("sha256", md5_value + packed_bytes, salt, 16)
|
||||
== hashlib.pbkdf2_hmac(
|
||||
"sha256",
|
||||
md5_value + packed_bytes,
|
||||
salt(hashlib.sha256(brotli.__version__)),
|
||||
16,
|
||||
)
|
||||
):
|
||||
return dill.loads(
|
||||
brotli.decompress(packed_bytes),
|
||||
@ -49,7 +54,10 @@ def enpack_llc_pack(sth: Any, to_dist: str):
|
||||
md5_value = hashlib.md5(packing_bytes).digest() # 长度 16
|
||||
|
||||
salty_sha256_value = hashlib.pbkdf2_hmac(
|
||||
"sha256", md5_value + packing_bytes, salt, 16
|
||||
"sha256",
|
||||
md5_value + packing_bytes,
|
||||
salt(hashlib.md5(salt(salt(brotli.__version__)))),
|
||||
16,
|
||||
) # 长度 32
|
||||
|
||||
with open(
|
||||
|
@ -4,8 +4,8 @@
|
||||
伶伦转换器 版本检查组件
|
||||
Linglun Converter Version Checking Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
@ -13,7 +13,7 @@ Terms & Conditions: License.md in the root directory
|
||||
|
||||
import requests
|
||||
|
||||
from .io import TrimLog, Sequence, Iterable, Callable, Optional, Dict, Union
|
||||
from .io import Callable, Dict, Iterable, Optional, Sequence, TrimLog, Union
|
||||
|
||||
|
||||
def is_ver_char(text: str) -> bool:
|
||||
|
@ -4,8 +4,8 @@
|
||||
伶伦转换器 HTML页组件
|
||||
Linglun Converter HTML Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
|
@ -4,8 +4,8 @@
|
||||
伶伦转换器 言论版组件
|
||||
Linglun Converter Yan Lun Component
|
||||
|
||||
版权所有 © 2024 金羿
|
||||
Copyright © 2024 EillesWan
|
||||
版权所有 © 2025 金羿
|
||||
Copyright © 2025 EillesWan
|
||||
|
||||
开源相关声明请见 仓库根目录下的 License.md
|
||||
Terms & Conditions: License.md in the root directory
|
||||
@ -25,9 +25,12 @@ yanlun_bg_colour = STANDART_BLACK
|
||||
logger.info("获取 言·论 信息……")
|
||||
|
||||
solar_datetime = zhDateTime.DateTime.now()
|
||||
lunar_datetime = solar_datetime.to_lunar()
|
||||
lunar_datetime = solar_datetime.to_chinese_format()
|
||||
solar_date = (solar_datetime.month, solar_datetime.day)
|
||||
lunar_date = (lunar_datetime.lunar_month, lunar_datetime.lunar_day)
|
||||
lunar_date = (
|
||||
lunar_datetime.chinese_calendar_month,
|
||||
lunar_datetime.chinese_calendar_day,
|
||||
)
|
||||
|
||||
if solar_date == (4, 3):
|
||||
yanlun_texts = ["金羿ELS 生日快乐~!", "Happy Birthday, Eilles!"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user