mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2026-01-22 19:52:06 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3b94f7445 | ||
|
|
59f5615a80 | ||
|
|
0d7a91904d | ||
|
|
1e56902bcc | ||
|
|
883ffbb10b | ||
|
|
4b6d922421 | ||
|
|
279c9c271e | ||
|
|
f0ca189938 | ||
|
|
1c66e5b174 | ||
|
|
f712965b70 | ||
|
|
c8aada96c2 | ||
|
|
319be8bbc0 |
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"]
|
||||||
564
LICENSE.md
564
LICENSE.md
@@ -1,218 +1,346 @@
|
|||||||
**注意,以下条款或版权声明应当且必须是高于此仓库中任何其他声明的**
|
<h1 align="center"><b><i>在 Gitee Push #4791dcd(不含)之后本仓库使用</i>《汉钰律许可协议,第一版》<i>授权开源</i></b></h1>
|
||||||
|
|
||||||
1. 伶伦的全部开发者享有其完整版权,其开发者可以在任一时刻终止以后伶伦源代码开放,若经由其开发者授予特殊权利,则授权对象可以将源代码进行特定的被特殊授权的操作
|
# 汉钰律许可协议,第一版
|
||||||
2. 伶伦或(及)其代码允许在 Apache2.0 协议的条款与说明下进行非商业使用
|
|
||||||
3. 除部分代码特殊声明外,伶伦允许对其或(及)其代码进行商业化使用,但是需要经过伶伦主要开发者(诸葛亮与八卦阵、金羿)的一致授权,同时,授权对象在商业化授权的使用过程中必须依照 Apache2.0 协议的条款与说明
|
**总第一版 第二次修订 · 二〇二四年七月七日编 二〇二五年四月二十六日修订**
|
||||||
4. 若存在对于伶伦包含的部分代码的特殊开源声明,则此部分代码依照其特定的开源方式授权,但若此部分代码经由此部分代码的主要开发者一致特殊授权后商用,则授权对象在商用时依照此部分的开发者所准许的方式(或条款)进行商用,或默认依照 Apache2.0 协议进行商业化使用
|
|
||||||
5. Apache2.0 协议的英文原文副本可见下文
|
## 一、重要须知
|
||||||
|
|
||||||
> The English Translation of the TERMS AND CONDITIONS above is listed below
|
1. 为保护采用本协议的作品在开源过程中,其著作权人所应有的权益,根据**中华人民共和国著作权法和相关法律法规**,制定本协议。
|
||||||
>
|
|
||||||
> This translated version is for reference only and has no legal effect.
|
2. 本协议履行过程中,请注意本协议中**免除或限制**民事主体**责任或权利**的条款、法律适用和争议解决条款(尤其是加有特殊标记的条款),这些条款应在中国法律所允许的范围内最大程度地适用。
|
||||||
>
|
|
||||||
> The version with legal effect is the Chinese version above.
|
3. 若本协议所涉及的自然人**未满 18 周岁**,该自然人应在监护人的陪同下阅读本协议及有关本协议的条款内容,并在取得其监护人同意后开始或继续应用本协议所授权的行为。
|
||||||
|
|
||||||
**Note, The TERMS AND CONDITIONS below should and must be above all others in this repository**
|
4. 由于互联网服务、互联网内容的特殊性,若本协议以电子协议形式分发并签订,其依然有效。您一旦开始对本协议所授权之作品进行本协议所授权的行为,即视为您已经阅读、理解并同意并已经接受本协议的全部条款。
|
||||||
|
|
||||||
1. _Linglun Studio_ is fully copyrighted by all its developers, the developers have the right to make _Linglun Studio_ close sourced at any time. Operations are permitted under specific terms instructed by its developer(s).
|
5. 本协议的订立、履行、解释及争议的解决均**适用中华人民共和国法律并排除其他一切冲突法的适用**。_本协议订立于许可证最初的颁发者的地址。若颁发者为自然人,则订立于该自然人户籍所在地;若为法人或非法人组织,则订立于其注册地_。本协议的订立各方应友好协商解决于协议所规定之行为的履行相关的争议;如协商不成,任何一方均可向合同签订地有管辖权的人民法院提起诉讼。
|
||||||
2. Non-commercial use of _Linglun Studio_ and(or) its source code is permitted under Apache License 2.0.
|
|
||||||
3. Commercial use of _Linglun Studio_ is permitted under Apache License 2.0 with the unanimous permission of the steering developers of _Linglun Studio_ (*bgArray*诸葛亮与八卦阵 and *Eilles*金羿).
|
6. 本协议的原本仅为现代汉语,书写于简体中文。若存在其他语言的翻译或其他同等语言但非简体中文文本的版本,应当无法律效力。
|
||||||
4. _Linglun Studio_ is open sourced under priority given:
|
|
||||||
1. License granted by the core developer(s) of a section after negotiation.
|
## 二、术语定义
|
||||||
2. Explicitly stated license.
|
|
||||||
3. Apache 2.0 License.
|
1. “**许可证**”、“**协议**”(后文称“本协议”)是指根据本文档中所列举的全部术语、定义、条款、限制等文本,是本合同的简称称谓。本合同全称是 **“汉钰律许可协议,第一版”**。
|
||||||
5. A copy of the original Apache Lisence 2.0 can be found below.
|
|
||||||
|
2. “**协议颁发者**”(后文称“颁发者”)是将条款或协议应用于其拥有著作财产权的作品的民事主体,或由其指定从而拥有颁发者身份的民事主体。
|
||||||
```text
|
|
||||||
Apache License
|
3. “**源**”形式是指对包括但不限于 软件、硬件、文档、配置项 等种类的作品进行修改、编辑的首选形式;若不存在首选形式,则初次编辑该作品所需的形式即为源形式。
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
4. “**目标**”形式是指对源形式进行机械转换、翻译、打印、制造、加工等同类型活动后形成的结果形式,包括但不限于源代码编译后的目标软件、生成的文件、转换出的媒体、制造出的机械、打印出的实体文本、加工后的零件。
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
5. “**采用本协议的作品**”(后文称“此作品”)是指经颁发者授权而使用本协议进行授权的任何作品,该作品应在自然人可见处明确附加一个自然人可读的版权通知(可以参考文末附录中提供的示例);若在一个可分割的作品中,部分地采用本协议进行授权,则该部分应当视为一个独立的采用本协议的作品,该作品应当在自然人可见处明确附加一个自然人可读的范围限定和版权通知(同样可以参考文末附录中提供的示例)。
|
||||||
|
|
||||||
1. Definitions.
|
6. “**贡献**”是指对作品进行的,意在提交给此作品颁发者以让著作权人包含在其作品中的任何修订或补充,该修订或补充同样属于一种作品。依据此定义,**“提交”**一词表示经由此作品颁发者所指定的形式,将其所进行的修改发送给此作品颁发者。该形式应当包括在此作品颁发者指定的平台内发送易于编辑的修改信息、在此作品颁发者指定的电子邮箱中发送易于编辑的修改信息、在此作品颁发者指定的源码控制系统或发布跟踪系统上提交的易于编辑的修改信息,但由著作权人以明显标注或指定为“非贡献”的活动除外。颁发者自己对作品进行的修改同样视作对作品的贡献。
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
7. “**贡献者**”是指此作品颁发者接受的贡献的提交者,或包含在作品的贡献清单中的民事主体。贡献者在提交贡献并经此作品颁发者通过且该贡献已经被应用于此作品中后,该贡献者应当视为此作品的著作权人之一,但不应视为此作品非其贡献的部分的著作权人。一个作品的颁发者同样属于其贡献者。**请注意**,针对贡献者提交的贡献,该贡献者应被视为该贡献的协议颁发者,但不应视作本作品的颁发者。
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
8. “**用户**”、“**使用者**”是指行使本协议所授权之行为的民事主体。据此,贡献者亦属于用户。
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
9. “**商业性使用**”、“**商用**”是指任何以谋取利益为目的的使用,包括但不限于以贩卖、出租的形式对作品进行使用;但若将该获取利益之活动明确指示为“捐赠”,且在获利者在进行本协议所授权的活动时不以捐赠数额为标准而区别之,则此种的获取利益的“捐赠”行为不属于商业性使用。
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
## 三、权利授予
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
1. 任何由颁发者所进行的特殊声明、特别注意等此类内容,应当在法律效力上高于本协议的条款或声明;这些声明若与本协议冲突,本协议的该冲突部分无效;本协议与这些声明共同构成颁发者与用户之间的合同。
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
2. 此作品的贡献者享有其贡献的完整著作权。
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
3. 此作品的贡献者将自己的贡献的全部著作财产权,免费、公开、不可撤销、无限期、非专有地授予此作品的全部著作权人,并准许其在全世界范围内使用上述权利;若无明确的标识,贡献者允许此作品的颁发者对其贡献进行免费、公开、不可撤销、无限期、非专有、世界范围内的商业性使用。
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
4. 此作品的著作权人及贡献者授予用户**免费、公开、不可撤销、非专有、非商用**地以任意形式**复制、发行、展览、表演、放映、广播、信息网络传播、摄制、改编、翻译、汇编、二次授权**的权利,准许其在此作品颁发者所指定的区域与时间内行使上述权利;若此作品颁发者未特别指定的,则视作在全世界范围内无限期地授权;若此作品颁发者特别指定在特定情况下可以商用,则应当按照其所指定的条件进行商业性使用,商用的过程中,应当明确标识此作品的著作权人。
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
5. 一旦此作品有任意由非贡献形式而产生的更改,更改的部分将不视为此作品的一部分,除非该部分不可离开此作品单独存在;若该部分必须依赖此作品而不可与此作品分离从而单独存在,则更改后的作品不视作此作品,在这种情况下,除非此更改后的作品已获得此作品颁发者的特殊许可、或更改者即为此作品颁发者本人,否则对该作品进行的任何活动都应当遵守本协议。
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
6. 经贡献而产生的对此作品的更改,属于此作品的一部分;在此情况下,更改后的作品,依旧视作此作品。
|
||||||
source, and configuration files.
|
|
||||||
|
7. 依据本款的第 4 条,若用户在本协议的授权下,将此作品授予他人进行任何形式的活动(即“二次授权”、“二次分发”),则应确保其使用的协议或授权内容,与本协议的条款不冲突;当存在与本协议条款的冲突时,则该冲突内容无效,被授权的第三方应依照本协议的条款进行活动;除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
8. 依据本款的第 5 条,若由非贡献形式而产生更改的部分是可分割而不需依赖此作品即可单独存在的,若该部分明确注明不使用本协议进行授权或明确声明了其他授权条款,则该部分不视作采用本协议;但未更改的部分仍应视作原此作品的一部分,需要采用本协议进行授权,除非此更改后的作品已获得此作品颁发者的特殊许可、或更改者即为此作品颁发者本人。
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
9. 若此作品或所提交的贡献包含其著作权人的专利,则该专利所有人即此作品的著作权人应准许此作品全体著作权人**免费、公开、不可撤销、非专有、无版权费的专利许可**,以便贡献者对作品进行本协议所授权进行的活动。
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
10. 上述专利许可的授予,仅适用于在所提交的贡献中,可由专利所有者授予的,且在对此作品进行本协议所授权的活动中,必须使用的专利。
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
11. 如果用户对任何民事主体,因其在进行本协议所授权进行的活动中侵犯该用户的专利而提起诉讼,那么根据本协议授予该用户的所有关于此作品的任何其他专利许可将在提起上述诉讼之日起终止。
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
12. 如果本作品作为用户的其他作品的不可分割的一部分进行任何民事活动,本协议依旧对本作品(即该用户的其他作品的一部分)生效;若本作品完全融入该用户的其他作品之中而不可独立存在,则该用户需要保证其作品存在与本协议冲突的条款;除非该作品已获得此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
## 四、使用条件
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
在对此作品进行本协议所授权的民事活动中,应当同时满足以下条款:
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
1. 用户必须为此作品的任何其他接收者提供本协议的副本,在不得已无法提供副本的情况下,也应明确指示其他接收者可查阅本协议的位置。
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
2. 用户必须在修改后的作品中附带明显的通知,声明用户已更改文件,并注明更改位置。
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
3. 若用户二次分发此作品,可以选择向此作品的接收者提供无偿或有偿的担保维修、支持服务或其他责任、义务。但是,该用户只可以其自己的名义提供上述内容,不得以任何其他贡献者的名义。且该用户必须明确表明任何此类责任或义务是由其个人独立提供,且其同意并应当承担赔偿此作品的全体贡献者因其个人承担上述责任义务而产生的任何赔偿责任。
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
4. 用户不得删除或更改此作品中包含的任何许可声明(包括版权声明,专利声明,免责声明,或赔偿责任限制),除非该更改是对已知事实错误的修补、或其已获得此作品颁发者的特殊许可、或更改者即为此作品颁发者本人。
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
5. 若此作品将权益的声明通知作为一部分,那么由用户分发的任何版本的作品中须至少在下列三处之一包含该声明通知的自然人可读副本:
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
- 该作品的权益声明通知中
|
||||||
communication on electronic mailing lists, source code control systems,
|
- 在源形式的文件中(当且仅当该作品开放源代码)
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
- 在惯例中作为第三方通知出现之处(当且仅当该作品会产生画面,且该画面可被自然人详细观察)
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
该通知的内容仅供信息提供,不应对许可证进行任何文字上的修改。用户可在其分发的作品中,在不构成修改本协议的前提下,在作品自身的声明通知或属性描述后或作为附录添加。
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
6. 依据本款第3条,若用户二次分发此作品时,选择向作品的接收者提供收费的担保服务,则必须明确告知该接收者本协议全部内容与此作品原出处,并确保其知悉上述内容;但若用户在二次分发此作品时,不选择提供任何服务,则该用户不允许向作品的接收者收取任何费用,除非该用户获得了此作品颁发者的特殊许可、或该用户即为此作品颁发者本人。
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
## 五、提交贡献
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
除非贡献者明确声明,在本作品中由该贡献者向颁发者的提供的提交,必须符合本协议的条款,并与本协议的条款不存在冲突;除非此贡献中与本协议冲突的附加条款已获得颁发者的特殊许可、或贡献者即为此作品颁发者本人。
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
## 六、商标相关
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
本协议并未授予用户,将颁发者的商标、专属标记或特定产品名称,用于合理的或惯例性的描述或此类声明之外其他任何位置的权利。
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
## 七、免责声明
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
1. 若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,**不予提供任何形式的担保、任何明示、任何暗示或类似承诺**,此类包括但不限于担保此作品毫无缺陷、担保此作品适于贩卖、担保此作品适于特定目的、担保使用此作品绝不侵权。用户将自行承担因此作品的质量或性能问题而产生的全部风险。若此作品在任何方面欠妥,将由用户(而非任何贡献者、而非任何颁发者)承担所有必要的服务、维修或除错的任何成本。本免责声明是本许可的重要组成部分。当且仅当遵守本免责声明时,本协议的其他条款中对本作品的使用授权方可生效。
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
2. 无论是因何种原因,如果不是在法律规定的特殊情况(如,确为贡献者的故意或重大过失)下或者经过了特殊准许,即使贡献者事先已知发生损害的可能,在使用本作品时,用户产生的任何直接、间接、特殊、偶然或必然造成的损失(包括但不限于商誉损失、工作延误、计算机系统故障等),**均不由任一贡献者承担**。
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
**以上是本许可协议的全部条款**
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
---
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
附录
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
**如何在自己的作品中应用 汉钰律许可协议**
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
若要在自己源形式的作品应用本协议,请在其中附加下面的通知模板,并将六角括号“〔〕”中的字段替换成自身的实际信息来替换(不包括括号本身)。这些文本必须以对应文件格式适当的注释句法包含在其中,可以是实体的纸质文档、也可以是网络公告或者计算机文件;或者脱离该源之外,另起一个新的文件,使之指向要应用本协议的那个作品。同时也建议将作品名或类别名以及目的说明之类的声明囊括在同一个可被打印的页面上作为版权通知的整体,这样更加容易的区分出第三方内容。
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
若需要在自己以目标形式存在的作品中应用本协议,同样需要附加下面的通知模板并更改六角括号中的字样。但是,这些文本可以是位于作品的标签上、位于作品的用户可见且能被自然人详细观察的画面之中、或者按照惯例中许可协议应该出现的位置;同时,这些文本的所处位置应当能够明确指示到本协议应用的那个作品。另外,建议将作品名或类别名以及目的说明之类的声明囊括在同一个可被打印的位置上作为版权通知的整体,这样更加容易的区分出第三方内容。
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
**通知模板**
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
```
|
||||||
meet the following conditions:
|
版权所有 © 〔年份〕 〔著作权人〕
|
||||||
|
〔或者:版权所有 (C) 〔年份〕 〔著作权人〕〕
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
〔该作品〕根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||||
|
任何人皆可从以下地址获得本协议副本:〔本协议副本所在地址〕。
|
||||||
(b) You must cause any modified files to carry prominent notices
|
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||||
stating that You changed the files; and
|
详细的准许和限制条款请见原协议文本。
|
||||||
|
```
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
<h1 align="center"><b><i>以下是旧版本(Gitee Push #4791dcd(含)之前)的协议声明</i></b></h1>
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
**注意,以下条款或版权声明应当且必须是高于此仓库中任何其他声明的**
|
||||||
the Derivative Works; and
|
|
||||||
|
1. 伶伦的全部开发者享有其完整版权,其开发者可以在任一时刻终止以后伶伦源代码开放,若经由其开发者授予特殊权利,则授权对象可以将源代码进行特定的被特殊授权的操作
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
2. 伶伦或(及)其代码允许在 Apache2.0 协议的条款与说明下进行非商业使用
|
||||||
distribution, then any Derivative Works that You distribute must
|
3. 除部分代码特殊声明外,伶伦允许对其或(及)其代码进行商业化使用,但是需要经过伶伦主要开发者(诸葛亮与八卦阵、金羿)的一致授权,同时,授权对象在商业化授权的使用过程中必须依照 Apache2.0 协议的条款与说明
|
||||||
include a readable copy of the attribution notices contained
|
4. 若存在对于伶伦包含的部分代码的特殊开源声明,则此部分代码依照其特定的开源方式授权,但若此部分代码经由此部分代码的主要开发者一致特殊授权后商用,则授权对象在商用时依照此部分的开发者所准许的方式(或条款)进行商用,在开发者未明确指定商用授权方式但已经许可进行商用时,则依照 Apache2.0 协议进行商业化使用
|
||||||
within such NOTICE file, excluding those notices that do not
|
5. Apache2.0 协议的英文原文副本可见下文
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
> The English Translation of the TERMS AND CONDITIONS above is listed below
|
||||||
as part of the Derivative Works; within the Source form or
|
>
|
||||||
documentation, if provided along with the Derivative Works; or,
|
> This translated version is for reference only and has no legal effect.
|
||||||
within a display generated by the Derivative Works, if and
|
>
|
||||||
wherever such third-party notices normally appear. The contents
|
> The version with legal effect is the Chinese version above.
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
**Note, The TERMS AND CONDITIONS below should and must be above all others in this repository**
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
1. _Linglun Studio_ is fully copyrighted by all its developers, the developers have the right to make _Linglun Studio_ close sourced at any time. Operations are permitted under specific terms instructed by its developer(s).
|
||||||
that such additional attribution notices cannot be construed
|
2. Non-commercial use of _Linglun Studio_ and(or) its source code is permitted under Apache License 2.0.
|
||||||
as modifying the License.
|
3. Commercial use of _Linglun Studio_ is permitted under Apache License 2.0 with the unanimous permission of the steering developers of _Linglun Studio_ (*bgArray*诸葛亮与八卦阵 and *Eilles*金羿).
|
||||||
|
4. _Linglun Studio_ is open sourced under priority given:
|
||||||
You may add Your own copyright statement to Your modifications and
|
1. License granted by the core developer(s) of a section after negotiation.
|
||||||
may provide additional or different license terms and conditions
|
2. Explicitly stated license.
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
3. Apache 2.0 License.
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
5. A copy of the original Apache Lisence 2.0 can be found below.
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
```text
|
||||||
|
Apache License
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
Version 2.0, January 2004
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
http://www.apache.org/licenses/
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
1. Definitions.
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
other entities that control, are controlled by, or are under common
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
control with that entity. For the purposes of this definition,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
implied, including, without limitation, any warranties or conditions
|
direction or management of such entity, whether by contract or
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
unless required by applicable law (such as deliberate and grossly
|
including but not limited to software source code, documentation
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
source, and configuration files.
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
"Object" form shall mean any form resulting from mechanical
|
||||||
result of this License or out of the use or inability to use the
|
transformation or translation of a Source form, including but
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
not limited to compiled object code, generated documentation,
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
and conversions to other media types.
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
copyright notice that is included in or attached to the work
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
(an example is provided in the Appendix below).
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
License. However, in accepting such obligations, You may act only
|
form, that is based on (or derived from) the Work and for which the
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
defend, and hold each Contributor harmless for any liability
|
of this License, Derivative Works shall not include works that remain
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
of your accepting any such warranty or additional liability.
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
Copyright © 2024 Team-Ryoun 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray")
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
you may not use this file except in compliance with the License.
|
means any form of electronic, verbal, or written communication sent
|
||||||
You may obtain a copy of the License at
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
Unless required by applicable law or agreed to in writing, software
|
excluding communication that is conspicuously marked or otherwise
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
limitations under the License.
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
```
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under 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: 金羿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
|
[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
|
[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 -->
|
<!-- [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/
|
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
|
||||||
# 然后安装(依次执行下面的指令)
|
# 然后安装(依次执行下面的指令)
|
||||||
apt-get install python-numpy
|
apt-get install python-numpy
|
||||||
pip install brotli TrimMCStruct
|
pip install Musicreater[full] TrimLog
|
||||||
pip install Musicreater TrimLog
|
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
python -m pip install --upgrade pip setuptools wheel
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -119,8 +118,7 @@
|
|||||||
之后再来安装即可
|
之后再来安装即可
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install brotli TrimMCStruct
|
pip install Musicreater[full] TrimLog
|
||||||
pip install Musicreater TrimLog
|
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
python -m pip install --upgrade pip setuptools wheel
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -133,7 +131,7 @@
|
|||||||
既然已经有了运行环境,那么我们就需要下载一个用来下载我们的**伶伦转换器**的工具,我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器,这个世界上你也找不到第二个,所以我们来安装一下:
|
既然已经有了运行环境,那么我们就需要下载一个用来下载我们的**伶伦转换器**的工具,我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器,这个世界上你也找不到第二个,所以我们来安装一下:
|
||||||
|
|
||||||
```bash
|
```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
|
git clone https://gitee.com/TriM-Organization/Linglun-Converter.git llc
|
||||||
```
|
```
|
||||||
|
|
||||||
当上述命令执行成功,你会在执行此命令的所在位置发现一个名为 `llc` 的文件夹,其中包含的正是我们心心念念下载的本程序源代码。
|
当上述命令执行成功,你会在执行此命令的所在位置发现一个名为 `llc` 的文件夹,其中包含的正是我们心心念念下载的本程序源代码。
|
||||||
本程序可以直接从源代码运行,因此,赶快进入下载到的文件夹:
|
本程序可以直接从源代码运行,因此,赶快进入下载到的文件夹:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -69,9 +69,7 @@
|
|||||||
2. 确认完成之后,我们来安装一下依赖库:
|
2. 确认完成之后,我们来安装一下依赖库:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install mido -i https://mirrors.aliyun.com/pypi/simple/
|
pip install Musicreater[full] -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 TrimLog -i https://mirrors.aliyun.com/pypi/simple/
|
pip install TrimLog -i https://mirrors.aliyun.com/pypi/simple/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
211
llc_cli.py
211
llc_cli.py
@@ -7,37 +7,44 @@
|
|||||||
伶伦转换器 命令行
|
伶伦转换器 命令行
|
||||||
Linglun Converter CLI
|
Linglun Converter CLI
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
伶伦转换器命令行版本(“本项目”)的协议颁发者为 金羿
|
||||||
Terms & Conditions: ./Lisense.md
|
The Licensor of _Linglun Converter CLI_("this project") is Eilles Wan.
|
||||||
|
|
||||||
|
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||||
|
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||||
|
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||||
|
详细的准许和限制条款请见原协议文本。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.0.7"
|
__version__ = "0.0.9"
|
||||||
|
|
||||||
|
|
||||||
import datetime
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
|
||||||
# import sys
|
|
||||||
|
|
||||||
import Musicreater
|
import Musicreater
|
||||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
from Musicreater import DEFAULT_PROGRESSBAR_STYLE
|
||||||
from Musicreater.plugin import ConvertConfig
|
|
||||||
from Musicreater.plugin.addonpack import (
|
from Musicreater.plugin.addonpack import (
|
||||||
to_addon_pack_in_delay,
|
to_addon_pack_in_delay,
|
||||||
to_addon_pack_in_repeater,
|
to_addon_pack_in_repeater,
|
||||||
to_addon_pack_in_score,
|
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 (
|
from Musicreater.plugin.mcstructfile import (
|
||||||
to_mcstructure_file_in_delay,
|
to_mcstructure_file_in_delay,
|
||||||
to_mcstructure_file_in_repeater,
|
to_mcstructure_file_in_repeater,
|
||||||
# to_mcstructure_file_in_score,
|
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, myWords, isin, bool_str, float_str
|
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
|
# from Musicreater.plugin.mcstructure import commands_to_structure, commands_to_redstone_delay_structure
|
||||||
|
|
||||||
@@ -76,33 +83,25 @@ logger.console.rule(
|
|||||||
style="#26E2FF",
|
style="#26E2FF",
|
||||||
)
|
)
|
||||||
|
|
||||||
nowYang = datetime.datetime.now()
|
|
||||||
|
|
||||||
if nowYang.month == 8 and nowYang.day == 6:
|
if solar_date == (4, 3):
|
||||||
# 诸葛八卦生日
|
# 诸葛八卦生日
|
||||||
logger.console.print(
|
style_ = "#7DB5F0 on #121110"
|
||||||
"[#7DB5F0 on #121110]今天可不是催更的日子!\n诸葛亮与八卦阵{}岁生日快乐!".format(
|
elif solar_date == (8, 6):
|
||||||
nowYang.year - 2008
|
|
||||||
),
|
|
||||||
style="#7DB5F0 on #121110",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
elif nowYang.month == 4 and nowYang.day == 3:
|
|
||||||
# 金羿生日快乐
|
# 金羿生日快乐
|
||||||
logger.console.print(
|
style_ = "#0089F2 on #F0F2F4"
|
||||||
"[#0089F2 on #F0F2F4]今天就不要催更啦!\n金羿{}岁生日快乐!".format(
|
elif solar_date == (8, 16):
|
||||||
nowYang.year - 2006
|
# 旧梦生日快乐
|
||||||
),
|
style_ = "#F0F2F4 on #0089F2" # TODO
|
||||||
style="#0089F2 on #F0F2F4",
|
|
||||||
justify="center",
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# 显示箴言部分
|
style_ = "#121110 on #F0F2F4"
|
||||||
logger.console.print(
|
# 显示箴言部分
|
||||||
"[#121110 on #F0F2F4]{}".format(random.choice(myWords)),
|
logger.console.print(
|
||||||
style="#121110 on #F0F2F4",
|
"[{}]{}".format(style_, random.choice(yanlun_texts)),
|
||||||
justify="center",
|
style=style_,
|
||||||
)
|
justify="center",
|
||||||
|
)
|
||||||
|
del style_
|
||||||
|
|
||||||
# prt(f"{_('LangChd')}{_(':')}{_(currentLang)}")
|
# prt(f"{_('LangChd')}{_(':')}{_(currentLang)}")
|
||||||
|
|
||||||
@@ -171,7 +170,7 @@ while True:
|
|||||||
|
|
||||||
def is_in_bdx_mcpack(sth: str):
|
def is_in_bdx_mcpack(sth: str):
|
||||||
return isin(
|
return isin(
|
||||||
sth,
|
sth.lower(),
|
||||||
{
|
{
|
||||||
1: ("bdx", "1", "币帝查", "币帝·艾克斯", "一", "幺"),
|
1: ("bdx", "1", "币帝查", "币帝·艾克斯", "一", "幺"),
|
||||||
0: ("mcpack", "0", "唉姆西·派克", "零", "〇"),
|
0: ("mcpack", "0", "唉姆西·派克", "零", "〇"),
|
||||||
@@ -180,19 +179,25 @@ def is_in_bdx_mcpack(sth: str):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_in_player(sth: str, in_ok: tuple = (0,1,2)):
|
def is_in_player(sth: str, in_ok: tuple = (0, 1, 2)):
|
||||||
return isin(
|
return isin(
|
||||||
sth,
|
sth.lower(),
|
||||||
dict(
|
dict(
|
||||||
[
|
[
|
||||||
(i, v)
|
(i, v)
|
||||||
for i, v in [
|
for i, v in [
|
||||||
(0,
|
(
|
||||||
("delay", "0", "延迟", "帝蕾"),),
|
0,
|
||||||
(1,
|
("delay", "0", "延迟", "帝蕾"),
|
||||||
("score", "1", "计分板", "积分", "积分板", "计分", "斯阔尔"),),
|
),
|
||||||
(2,
|
(
|
||||||
("repeater", "2", "中继器", "瑞皮特"),),
|
1,
|
||||||
|
("score", "1", "计分板", "积分", "积分板", "计分", "斯阔尔"),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
2,
|
||||||
|
("repeater", "2", "中继器", "瑞皮特"),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
if i in in_ok
|
if i in in_ok
|
||||||
]
|
]
|
||||||
@@ -201,32 +206,26 @@ def is_in_player(sth: str, in_ok: tuple = (0,1,2)):
|
|||||||
|
|
||||||
|
|
||||||
output_file_format = format_ipt(
|
output_file_format = format_ipt(
|
||||||
"输出文件类型 (mcpack/0|bdx/1)",
|
"输出文件类型 (mcpack/0|bdx/1|mcstructure/2):",
|
||||||
is_in_bdx_mcpack,
|
is_in_bdx_mcpack,
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
|
|
||||||
if output_file_format == 0:
|
if output_file_format == 1:
|
||||||
player_format = format_ipt(
|
player_format = format_ipt(
|
||||||
"播放器类型 (延迟/0|计分板/1|中继器/2)",
|
"播放器类型 (延迟/0|计分板/1):",
|
||||||
is_in_player,
|
|
||||||
"输入内容有误,请重新输入。",
|
|
||||||
)[1]
|
|
||||||
elif output_file_format == 1:
|
|
||||||
player_format = format_ipt(
|
|
||||||
"播放器类型 (延迟/0|计分板/1)",
|
|
||||||
lambda a: is_in_player(a, (0, 1)),
|
lambda a: is_in_player(a, (0, 1)),
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
else:
|
else:
|
||||||
player_format = format_ipt(
|
player_format = format_ipt(
|
||||||
"播放器类型 (延迟/0|中继器/2)",
|
"播放器类型 (延迟/0|计分板/1|中继器/2):",
|
||||||
lambda a: is_in_player(a, (0, 2)),
|
is_in_player,
|
||||||
"输入内容有误,请重新输入。",
|
"输入内容有误,请重新输入。",
|
||||||
)[1]
|
)[1]
|
||||||
|
|
||||||
old_exe_enabled = not format_ipt(
|
old_exe_enabled = format_ipt(
|
||||||
"启用新版代执行指令 (否/0|是/1):",
|
"启用旧版代行指令 (否/0|是/1):",
|
||||||
bool_str,
|
bool_str,
|
||||||
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
||||||
)[1]
|
)[1]
|
||||||
@@ -242,17 +241,21 @@ else:
|
|||||||
prompts = []
|
prompts = []
|
||||||
# 提示语 检测函数 错误提示语
|
# 提示语 检测函数 错误提示语
|
||||||
for args in [
|
for args in [
|
||||||
(
|
|
||||||
"音量大小 (0,1]:",
|
|
||||||
float_str,
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
"速度倍率 (0,+∞):",
|
"速度倍率 (0,+∞):",
|
||||||
float_str,
|
float_str,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"自动生成进度条 (否/0|是/1):",
|
"最小音量 (0,1]:",
|
||||||
bool_str,
|
float_str,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(
|
||||||
|
"自动生成进度条 (否/0|是/1):",
|
||||||
|
bool_str,
|
||||||
|
)
|
||||||
|
if output_file_format != 2
|
||||||
|
else ()
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
@@ -281,7 +284,7 @@ else:
|
|||||||
if output_file_format == 1
|
if output_file_format == 1
|
||||||
else (
|
else (
|
||||||
(
|
(
|
||||||
"结构延展方向(x+|z+|x-|z-):",
|
"结构延展方向 (x+|z+|x-|z-):",
|
||||||
lambda a: isin(
|
lambda a: isin(
|
||||||
a,
|
a,
|
||||||
{
|
{
|
||||||
@@ -298,16 +301,16 @@ else:
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
"结构生成最大高度 (0,+∞):",
|
"基础底部方块 (例:concrete):",
|
||||||
int_str,
|
str,
|
||||||
)
|
)
|
||||||
if player_format == 0
|
if (player_format == 2 and output_file_format == 2)
|
||||||
else (
|
else (
|
||||||
(
|
(
|
||||||
"基础空白方块(例:concrete):",
|
"结构生成最大高度 (0,+∞):",
|
||||||
str,
|
int_str,
|
||||||
)
|
)
|
||||||
if (player_format == 2 and output_file_format == 2)
|
if player_format == 0 or output_file_format != 0
|
||||||
else ()
|
else ()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -319,22 +322,26 @@ else:
|
|||||||
)[1]
|
)[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
if prompts[2]:
|
if output_file_format != 2 and prompts[2]:
|
||||||
|
style = DEFAULT_PROGRESSBAR_STYLE
|
||||||
costom_pgb_enabled = format_ipt(
|
costom_pgb_enabled = format_ipt(
|
||||||
"自定义进度条样式 (否/0|是/1):",
|
"自定义进度条样式 (否/0|是/1):",
|
||||||
bool_str,
|
bool_str,
|
||||||
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
"输入内容格式错误,应为 是/1/真/t/y 或 否/0/假/f/n",
|
||||||
)[1]
|
)[1]
|
||||||
if costom_pgb_enabled:
|
if costom_pgb_enabled:
|
||||||
style = ipt("基本样式组 (回车默认):")
|
|
||||||
if not style:
|
base_style = ipt("基本样式组 (留空默认):")
|
||||||
style = DEFAULT_PROGRESSBAR_STYLE[0]
|
if base_style:
|
||||||
yet_part = ipt("未播放样式 (回车默认):")
|
style.set_base_style(base_style)
|
||||||
if not yet_part:
|
yet_part = ipt("未播放样式 (留空默认):")
|
||||||
yet_part = DEFAULT_PROGRESSBAR_STYLE[1][1]
|
if yet_part:
|
||||||
done_part = ipt("已播放样式 (回车默认):")
|
style.set_to_play_style(yet_part)
|
||||||
if not done_part:
|
done_part = ipt("已播放样式 (留空默认):")
|
||||||
done_part = DEFAULT_PROGRESSBAR_STYLE[1][0]
|
if done_part:
|
||||||
|
style.set_played_style(done_part)
|
||||||
|
else:
|
||||||
|
style = None
|
||||||
|
|
||||||
if output_file_format == 0:
|
if output_file_format == 0:
|
||||||
if player_format == 1:
|
if player_format == 1:
|
||||||
@@ -343,9 +350,10 @@ if output_file_format == 0:
|
|||||||
cvt_method = to_addon_pack_in_delay
|
cvt_method = to_addon_pack_in_delay
|
||||||
elif player_format == 2:
|
elif player_format == 2:
|
||||||
cvt_method = to_addon_pack_in_repeater
|
cvt_method = to_addon_pack_in_repeater
|
||||||
|
|
||||||
elif output_file_format == 2:
|
elif output_file_format == 2:
|
||||||
# if player_format == 1:
|
if player_format == 1:
|
||||||
# cvt_method = to_mcstructure_file_in_score
|
cvt_method = to_mcstructure_file_in_score
|
||||||
if player_format == 0:
|
if player_format == 0:
|
||||||
cvt_method = to_mcstructure_file_in_delay
|
cvt_method = to_mcstructure_file_in_delay
|
||||||
elif player_format == 2:
|
elif player_format == 2:
|
||||||
@@ -355,36 +363,37 @@ elif output_file_format == 2:
|
|||||||
for singleMidi in midis:
|
for singleMidi in midis:
|
||||||
prt("\n" f"正在处理 {singleMidi}")
|
prt("\n" f"正在处理 {singleMidi}")
|
||||||
cvt_mid = Musicreater.MidiConvert.from_midi_file(
|
cvt_mid = Musicreater.MidiConvert.from_midi_file(
|
||||||
singleMidi, old_exe_format=old_exe_enabled
|
midi_file_path=singleMidi,
|
||||||
)
|
play_speed=prompts[0],
|
||||||
cvt_cfg = ConvertConfig(
|
old_exe_format=old_exe_enabled,
|
||||||
out_path,
|
min_volume=prompts[1],
|
||||||
*prompts[:2],
|
|
||||||
progressbar=(
|
|
||||||
((style, (done_part, yet_part)) if costom_pgb_enabled else True) # type: ignore
|
|
||||||
if prompts[2]
|
|
||||||
else False
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
conversion_result = (
|
conversion_result = (
|
||||||
(cvt_method(cvt_mid, cvt_cfg, *prompts[3:])) # type: ignore
|
(cvt_method(cvt_mid, out_path, style, *prompts[3:])) # type: ignore
|
||||||
if output_file_format == 0
|
if output_file_format == 0
|
||||||
else (
|
else (
|
||||||
(
|
(
|
||||||
to_BDX_file_in_score(cvt_mid, cvt_cfg, *prompts[3:])
|
to_BDX_file_in_score(cvt_mid, out_path, style, *prompts[3:])
|
||||||
if player_format == 1
|
if player_format == 1
|
||||||
else to_BDX_file_in_delay(cvt_mid, cvt_cfg, *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, cvt_cfg, *prompts[3:])) # type: ignore
|
else (cvt_method(cvt_mid, out_path, *prompts[2:]))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
prt(
|
prt(
|
||||||
f" 结构大小:{conversion_result[0]},播放刻数:{conversion_result[1]}"
|
"\t{}:{},播放刻数:{}{}".format(
|
||||||
if output_file_format == 2
|
"结构大小" if output_file_format == 2 else "指令总长",
|
||||||
else f" 指令总长:{conversion_result[0]},播放刻数:{conversion_result[1]}{f''',结构大小:{conversion_result[2]},末点坐标:{conversion_result[3]}''' if output_file_format == 1 else ''}" # type: ignore
|
conversion_result[0],
|
||||||
|
conversion_result[1],
|
||||||
|
(
|
||||||
|
",结构大小:{},末点坐标:{}".format(*conversion_result[2:])
|
||||||
|
if output_file_format == 1
|
||||||
|
else ""
|
||||||
|
),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
exitSth = ipt("结束。换行以退出程序。")
|
exitSth = ipt("结束。换行以退出程序。")
|
||||||
|
|||||||
@@ -7,11 +7,16 @@
|
|||||||
伶伦转换器暨模组特用奇巧
|
伶伦转换器暨模组特用奇巧
|
||||||
Linglun Converter for Special Use with addons
|
Linglun Converter for Special Use with addons
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
伶伦转换器暨模组特用奇巧版本(“本项目”)的协议颁发者为 金羿
|
||||||
Terms & Conditions: ./Lisense.md
|
The Licensor of _Linglun Converter for Special Use with addons_("this project") is Eilles Wan.
|
||||||
|
|
||||||
|
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||||
|
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||||
|
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||||
|
详细的准许和限制条款请见原协议文本。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.0.1"
|
__version__ = "0.0.1"
|
||||||
|
|||||||
@@ -4,11 +4,16 @@
|
|||||||
伶伦转换器 WXGUI
|
伶伦转换器 WXGUI
|
||||||
Linglun Converter WxPython GUI
|
Linglun Converter WxPython GUI
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
伶伦转换器WXGUI版本(“本项目”)的协议颁发者为 金羿
|
||||||
Terms & Conditions: ./Lisense.md
|
The Licensor of _Linglun Converter WxPython GUI_("this project") is Eilles Wan.
|
||||||
|
|
||||||
|
本项目根据 汉钰律许可协议,第一版(“本协议”)授权。
|
||||||
|
任何人皆可从以下地址获得本协议副本:https://gitee.com/EillesWan/YulvLicenses。
|
||||||
|
若非因法律要求或经过了特殊准许,此作品在根据本协议“原样”提供的基础上,不予提供任何形式的担保、任何明示、任何暗示或类似承诺。也就是说,用户将自行承担因此作品的质量或性能问题而产生的全部风险。
|
||||||
|
详细的准许和限制条款请见原协议文本。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +21,6 @@ Terms & Conditions: ./Lisense.md
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
# from types import ModuleType
|
# from types import ModuleType
|
||||||
@@ -35,25 +39,28 @@ if sys.argv:
|
|||||||
import Musicreater
|
import Musicreater
|
||||||
import Musicreater.experiment as Musicreater_experiment
|
import Musicreater.experiment as Musicreater_experiment
|
||||||
import Musicreater.plugin
|
import Musicreater.plugin
|
||||||
|
import wx
|
||||||
|
import wx.propgrid as pg
|
||||||
|
import wx.xrc
|
||||||
from Musicreater.plugin.addonpack import (
|
from Musicreater.plugin.addonpack import (
|
||||||
to_addon_pack_in_delay,
|
to_addon_pack_in_delay,
|
||||||
to_addon_pack_in_repeater,
|
to_addon_pack_in_repeater,
|
||||||
to_addon_pack_in_score,
|
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.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.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.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.webview import go_update_tip
|
||||||
|
from utils.yanlun import yanlun_bg_colour, yanlun_fg_colour, yanlun_texts
|
||||||
|
|
||||||
WHITE = (242, 244, 246) # F2F4F6
|
WHITE = (242, 244, 246) # F2F4F6
|
||||||
# WHITE2 = (248, 252, 255)
|
# WHITE2 = (248, 252, 255)
|
||||||
@@ -69,8 +76,8 @@ BLACK = (18, 17, 16) # 121110
|
|||||||
|
|
||||||
|
|
||||||
__appname__ = "伶伦转换器"
|
__appname__ = "伶伦转换器"
|
||||||
__version__ = "WXGUI 1.2.0"
|
__version__ = "WXGUI 1.2.1"
|
||||||
__zhver__ = "WX图形界面 初代次版"
|
__zhver__ = "WX图形界面 初代次版一编"
|
||||||
|
|
||||||
|
|
||||||
logger.info("检查更新")
|
logger.info("检查更新")
|
||||||
@@ -281,10 +288,14 @@ convert_tables = {
|
|||||||
"PITCHED": {
|
"PITCHED": {
|
||||||
"“偷吃”对照表": Musicreater.MM_TOUCH_PITCHED_INSTRUMENT_TABLE,
|
"“偷吃”对照表": Musicreater.MM_TOUCH_PITCHED_INSTRUMENT_TABLE,
|
||||||
"“经典”对照表": Musicreater.MM_CLASSIC_PITCHED_INSTRUMENT_TABLE,
|
"“经典”对照表": Musicreater.MM_CLASSIC_PITCHED_INSTRUMENT_TABLE,
|
||||||
|
"“断联”对照表": Musicreater.MM_DISLINK_PITCHED_INSTRUMENT_TABLE,
|
||||||
|
"“NBS”对照表": Musicreater.MM_NBS_PITCHED_INSTRUMENT_TABLE,
|
||||||
},
|
},
|
||||||
"PERCUSSION": {
|
"PERCUSSION": {
|
||||||
"“偷吃”对照表": Musicreater.MM_TOUCH_PERCUSSION_INSTRUMENT_TABLE,
|
"“偷吃”对照表": Musicreater.MM_TOUCH_PERCUSSION_INSTRUMENT_TABLE,
|
||||||
"“经典”对照表": Musicreater.MM_CLASSIC_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 = {
|
convert_table_selection = {
|
||||||
@@ -740,7 +751,7 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL
|
wx.StaticBox(self, wx.ID_ANY, "选择输出格式"), wx.VERTICAL
|
||||||
)
|
)
|
||||||
|
|
||||||
m_outformatChoice_choice1Choices = ["附加包", "BDX结构"]
|
m_outformatChoice_choice1Choices = ["附加包", "MCSTRUCTURE结构", "BDX结构"]
|
||||||
self.m_outformatChoice_choice1 = wx.Choice(
|
self.m_outformatChoice_choice1 = wx.Choice(
|
||||||
ss_outputFormatChooseSizer.GetStaticBox(),
|
ss_outputFormatChooseSizer.GetStaticBox(),
|
||||||
wx.ID_ANY,
|
wx.ID_ANY,
|
||||||
@@ -769,7 +780,7 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
m_playerChoice_choice2Choices,
|
m_playerChoice_choice2Choices,
|
||||||
0,
|
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)
|
ss_playerChooseSizer.Add(self.m_playerChoice_choice2, 0, wx.ALL | wx.EXPAND, 5)
|
||||||
|
|
||||||
s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5)
|
s_formatChooseSizer.Add(ss_playerChooseSizer, 1, wx.ALL | wx.EXPAND, 5)
|
||||||
@@ -1250,7 +1261,7 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
None,
|
None,
|
||||||
message="选择MIDI文件",
|
message="选择MIDI文件",
|
||||||
defaultDir="./",
|
defaultDir="./",
|
||||||
wildcard="MIDI 序列 (*.mid;*.midi)|*.mid;*.midi",
|
wildcard="Midi数字乐谱 (*.mid;*.midi)|*.mid;*.midi",
|
||||||
style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_FILE_MUST_EXIST,
|
style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_FILE_MUST_EXIST,
|
||||||
)
|
)
|
||||||
dialogResult = fileDialog.ShowModal()
|
dialogResult = fileDialog.ShowModal()
|
||||||
@@ -1266,17 +1277,30 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
|
|
||||||
def onOutputFormatChosen(self, event):
|
def onOutputFormatChosen(self, event):
|
||||||
# 0: 附加包
|
# 0: 附加包
|
||||||
# 1: BDX
|
# 1: MCSTRUCTURE
|
||||||
|
# 2: BDX
|
||||||
# prt("选择中:",self.m_outformatChoice_choice1.GetSelection())
|
# prt("选择中:",self.m_outformatChoice_choice1.GetSelection())
|
||||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||||
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
|
self.m_EnteringBDXfileSignName_textCtrl12.Enable(False)
|
||||||
|
|
||||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||||
self.m_StructureHeight_slider7.Enable(False)
|
self.m_StructureHeight_slider7.Enable(False)
|
||||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
||||||
else:
|
else:
|
||||||
self.m_StructureHeight_slider7.Enable(True)
|
self.m_StructureHeight_slider7.Enable(True)
|
||||||
self.m_enteringStructureMaxHeight_spinCtrl1.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_EnteringBDXfileSignName_textCtrl12.Enable(True)
|
||||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||||
self.m_StructureHeight_slider7.Enable(True)
|
self.m_StructureHeight_slider7.Enable(True)
|
||||||
@@ -1285,20 +1309,27 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
# 0 计分板 1 延时 2中继器
|
# 0 计分板 1 延时 2中继器
|
||||||
if self.m_playerChoice_choice2.GetSelection() == 0:
|
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||||
self.m_PlayerSelectorEntering_comboBox1.Enable(False)
|
self.m_PlayerSelectorEntering_comboBox1.Enable(False)
|
||||||
self.m_StructureHeight_slider7.Enable(False)
|
|
||||||
|
|
||||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||||
self.m_enteringStructureMaxHeight_spinCtrl1.Enable(False)
|
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_enteringStructureMaxHeight_spinCtrl1.Enable(True)
|
||||||
|
self.m_StructureHeight_slider7.Enable(True)
|
||||||
|
|
||||||
self.m_ScoreboardNameEntering_textCtrl9.Enable(True)
|
self.m_ScoreboardNameEntering_textCtrl9.Enable(True)
|
||||||
self.m_IsAutoResetScoreboard_checkBox2.Enable(True)
|
self.m_IsAutoResetScoreboard_checkBox2.Enable(True)
|
||||||
else:
|
else:
|
||||||
self.m_PlayerSelectorEntering_comboBox1.Enable(True)
|
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_ScoreboardNameEntering_textCtrl9.Enable(False)
|
||||||
self.m_IsAutoResetScoreboard_checkBox2.Enable(False)
|
self.m_IsAutoResetScoreboard_checkBox2.Enable(False)
|
||||||
@@ -1415,7 +1446,8 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 0: 附加包
|
# 0: 附加包
|
||||||
# 1: BDX
|
# 1: mcstructure
|
||||||
|
# 2: BDX
|
||||||
|
|
||||||
# 0 计分板 1 延时 2中继器
|
# 0 计分板 1 延时 2中继器
|
||||||
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
if self.m_outformatChoice_choice1.GetSelection() == 0:
|
||||||
@@ -1458,6 +1490,50 @@ class ConvertPagePanel(wx.Panel):
|
|||||||
wx.YES_DEFAULT | wx.ICON_INFORMATION,
|
wx.YES_DEFAULT | wx.ICON_INFORMATION,
|
||||||
).ShowModal()
|
).ShowModal()
|
||||||
elif self.m_outformatChoice_choice1.GetSelection() == 1:
|
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:
|
if self.m_playerChoice_choice2.GetSelection() == 0:
|
||||||
cmd_num, total_delay, size, final_pos = to_BDX_file_in_score(
|
cmd_num, total_delay, size, final_pos = to_BDX_file_in_score(
|
||||||
midi_cvt=mid_cvt,
|
midi_cvt=mid_cvt,
|
||||||
@@ -1777,9 +1853,7 @@ class SettingPagePannel(wx.Panel):
|
|||||||
wx.ID_ANY,
|
wx.ID_ANY,
|
||||||
wx.DefaultPosition,
|
wx.DefaultPosition,
|
||||||
wx.DefaultSize,
|
wx.DefaultSize,
|
||||||
pg.PG_BOLD_MODIFIED
|
pg.PG_BOLD_MODIFIED | pg.PG_HIDE_MARGIN | pg.PG_SPLITTER_AUTO_CENTER,
|
||||||
| pg.PG_HIDE_MARGIN
|
|
||||||
| pg.PG_SPLITTER_AUTO_CENTER,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.m_pitched_notes_table_propertyGrid1.SetFont(
|
self.m_pitched_notes_table_propertyGrid1.SetFont(
|
||||||
@@ -1862,9 +1936,7 @@ class SettingPagePannel(wx.Panel):
|
|||||||
wx.ID_ANY,
|
wx.ID_ANY,
|
||||||
wx.DefaultPosition,
|
wx.DefaultPosition,
|
||||||
wx.DefaultSize,
|
wx.DefaultSize,
|
||||||
pg.PG_BOLD_MODIFIED
|
pg.PG_BOLD_MODIFIED | pg.PG_HIDE_MARGIN | pg.PG_SPLITTER_AUTO_CENTER,
|
||||||
| pg.PG_HIDE_MARGIN
|
|
||||||
| pg.PG_SPLITTER_AUTO_CENTER,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.m_percussion_notes_table_propertyGrid11.SetFont(
|
self.m_percussion_notes_table_propertyGrid11.SetFont(
|
||||||
@@ -2033,7 +2105,7 @@ class SettingPagePannel(wx.Panel):
|
|||||||
)
|
)
|
||||||
if "自定义对照表" not in self.m_pitched_instrument_table_choice.Items:
|
if "自定义对照表" not in self.m_pitched_instrument_table_choice.Items:
|
||||||
self.m_pitched_instrument_table_choice.Append("自定义对照表")
|
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):
|
def onPitchedInstTableChanging(self, event):
|
||||||
event.Skip()
|
event.Skip()
|
||||||
@@ -2082,7 +2154,7 @@ class SettingPagePannel(wx.Panel):
|
|||||||
)
|
)
|
||||||
if "自定义对照表" not in self.m_percussion_instrument_table_choice1.Items:
|
if "自定义对照表" not in self.m_percussion_instrument_table_choice1.Items:
|
||||||
self.m_percussion_instrument_table_choice1.Append("自定义对照表")
|
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):
|
def onPercussionInstTableChanging(self, event):
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|||||||
1
pyinstaller_build.bat
Normal file
1
pyinstaller_build.bat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pyinstaller -D ./llc_win_wxPython.py -i ./resources/LLC_LOGO_OK_PLAIN_BANNER.ico --hide-console minimize-late --clean -n 伶伦转换器
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
Musicreater>=2.1.0.1
|
Musicreater[full]>=2.1.0.1
|
||||||
TrimLog>=0.8.3
|
TrimLog>=0.8.3
|
||||||
requests>=2.0.0
|
requests>=2.0.0
|
||||||
TrimMCStruct>=1.0.0
|
|
||||||
rich
|
|
||||||
wxPython
|
wxPython
|
||||||
dill
|
dill
|
||||||
brotli
|
# fcwslib=3.0.1
|
||||||
fcwslib=3.0.1
|
zhDateTime>=2.0.0
|
||||||
zhDateTime>=1.0.3
|
|
||||||
|
|||||||
@@ -4,18 +4,17 @@
|
|||||||
伶伦转换器 作者信息组件
|
伶伦转换器 作者信息组件
|
||||||
Linglun Converter Author Page Component
|
Linglun Converter Author Page Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
import wx.xrc
|
|
||||||
import wx.media
|
import wx.media
|
||||||
|
import wx.xrc
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
## Class LingLunAuthorPageFrame
|
## Class LingLunAuthorPageFrame
|
||||||
|
|||||||
15
utils/io.py
15
utils/io.py
@@ -4,11 +4,11 @@
|
|||||||
伶伦转换器 命令行组件
|
伶伦转换器 命令行组件
|
||||||
Linglun Converter Command Line IO Component
|
Linglun Converter Command Line IO Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -16,20 +16,19 @@ from typing import (
|
|||||||
Any,
|
Any,
|
||||||
Callable,
|
Callable,
|
||||||
Dict,
|
Dict,
|
||||||
|
Iterable,
|
||||||
List,
|
List,
|
||||||
Literal,
|
Literal,
|
||||||
Optional,
|
Optional,
|
||||||
|
Sequence,
|
||||||
Set,
|
Set,
|
||||||
TextIO,
|
TextIO,
|
||||||
Tuple,
|
Tuple,
|
||||||
Iterable,
|
|
||||||
Sequence,
|
|
||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
import TrimLog
|
import TrimLog
|
||||||
from TrimLog import object_constants, logger, log__init__
|
from TrimLog import log__init__, logger, object_constants
|
||||||
|
|
||||||
|
|
||||||
logger.is_logging = True
|
logger.is_logging = True
|
||||||
logger.suffix = ".llc"
|
logger.suffix = ".llc"
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
伶伦转换器 本地化组件
|
伶伦转换器 本地化组件
|
||||||
Linglun Converter Language Localization Component
|
Linglun Converter Language Localization Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from .io import logger, Any
|
from .io import Any, logger
|
||||||
|
|
||||||
|
|
||||||
def _() -> str:
|
def _() -> str:
|
||||||
|
|||||||
@@ -2,23 +2,23 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
伶伦转换器 打包存档组件
|
伶伦转换器 打包存档组件
|
||||||
Linglun Converter Language Localization Component
|
Linglun Converter Data Package Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
import dill
|
|
||||||
import brotli
|
import brotli
|
||||||
|
import dill
|
||||||
|
|
||||||
from .salt import salt
|
|
||||||
from .io import Any
|
from .io import Any
|
||||||
|
from .salt import salt
|
||||||
|
|
||||||
|
|
||||||
def unpack_llc_pack(from_dist: str, raise_error: bool = True):
|
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 (
|
if (md5_value == hashlib.md5(packed_bytes).digest()) and (
|
||||||
salty_sha256_value
|
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(
|
return dill.loads(
|
||||||
brotli.decompress(packed_bytes),
|
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
|
md5_value = hashlib.md5(packing_bytes).digest() # 长度 16
|
||||||
|
|
||||||
salty_sha256_value = hashlib.pbkdf2_hmac(
|
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
|
) # 长度 32
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
|
|||||||
@@ -4,20 +4,20 @@
|
|||||||
伶伦转换器 版本检查组件
|
伶伦转换器 版本检查组件
|
||||||
Linglun Converter Version Checking Component
|
Linglun Converter Version Checking Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import requests
|
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:
|
def is_ver_char(text: str) -> bool:
|
||||||
return text.isnumeric() or text == "."
|
return text.isnumeric() or text in ".-"
|
||||||
|
|
||||||
|
|
||||||
def cut_ver_str(text: str) -> str:
|
def cut_ver_str(text: str) -> str:
|
||||||
@@ -30,8 +30,12 @@ def cut_ver_str(text: str) -> str:
|
|||||||
while is_ver_char(text[j]) and j < len_of_text:
|
while is_ver_char(text[j]) and j < len_of_text:
|
||||||
j += 1
|
j += 1
|
||||||
temp_str = text[i:j].strip()
|
temp_str = text[i:j].strip()
|
||||||
if ("." in temp_str) and (temp_str[0] != ".") and (temp_str[-1] != "."):
|
if (
|
||||||
return temp_str
|
("." in temp_str or "-" in temp_str)
|
||||||
|
and (temp_str[0] not in ".-")
|
||||||
|
and (temp_str[-1] not in ".-")
|
||||||
|
):
|
||||||
|
return temp_str.replace("-", ".")
|
||||||
i = j
|
i = j
|
||||||
i += 1
|
i += 1
|
||||||
return ""
|
return ""
|
||||||
@@ -48,8 +52,12 @@ def get_ver_str(text: str) -> Iterable[str]:
|
|||||||
while is_ver_char(text[j]) and j < len_of_text:
|
while is_ver_char(text[j]) and j < len_of_text:
|
||||||
j += 1
|
j += 1
|
||||||
temp_str = text[i:j].strip()
|
temp_str = text[i:j].strip()
|
||||||
if ("." in temp_str) and (temp_str[0] != ".") and (temp_str[-1] != "."):
|
if (
|
||||||
all_ver_str.append(temp_str)
|
("." in temp_str or "-" in temp_str)
|
||||||
|
and (temp_str[0] not in ".-")
|
||||||
|
and (temp_str[-1] not in ".-")
|
||||||
|
):
|
||||||
|
all_ver_str.append(temp_str.replace("-", "."))
|
||||||
i = j
|
i = j
|
||||||
i += 1
|
i += 1
|
||||||
return all_ver_str
|
return all_ver_str
|
||||||
@@ -78,7 +86,7 @@ def check_update_repo(
|
|||||||
if not version_disp:
|
if not version_disp:
|
||||||
version_disp = version_now
|
version_disp = version_now
|
||||||
|
|
||||||
logger.info("当前 {} 版本:{}".format(appname,version_now))
|
logger.info("当前 {} 版本:{}".format(appname, version_now))
|
||||||
try:
|
try:
|
||||||
code_content: str = requests.get(get_text_url).text
|
code_content: str = requests.get(get_text_url).text
|
||||||
except Exception as E: # noinspection PyBroadException
|
except Exception as E: # noinspection PyBroadException
|
||||||
@@ -89,7 +97,7 @@ def check_update_repo(
|
|||||||
code_content = code_content[code_content.find('"') + 1 :]
|
code_content = code_content[code_content.find('"') + 1 :]
|
||||||
version_content = code_content[: code_content.find('"')]
|
version_content = code_content[: code_content.find('"')]
|
||||||
|
|
||||||
logger.info("已获取 {} 新版本信息:{}".format(appname,version_content))
|
logger.info("已获取 {} 新版本信息:{}".format(appname, version_content))
|
||||||
|
|
||||||
if is_ver_bigger(
|
if is_ver_bigger(
|
||||||
[int(v) for v in cut_ver_str(version_content).split(".")],
|
[int(v) for v in cut_ver_str(version_content).split(".")],
|
||||||
@@ -130,7 +138,7 @@ def check_update_release(
|
|||||||
version_renew_tip: str = "!有新版本!\n最新的 {app} 已经是 {latest} 版本,当前您正在使用的仍是 {current} 版本,是否更新?",
|
version_renew_tip: str = "!有新版本!\n最新的 {app} 已经是 {latest} 版本,当前您正在使用的仍是 {current} 版本,是否更新?",
|
||||||
) -> Union[None, Dict[str, str]]:
|
) -> Union[None, Dict[str, str]]:
|
||||||
|
|
||||||
logger.info("当前 {} 版本:{}".format(appname,version_now))
|
logger.info("当前 {} 版本:{}".format(appname, version_now))
|
||||||
try:
|
try:
|
||||||
code_content: Dict = requests.get(get_release_url).json()
|
code_content: Dict = requests.get(get_release_url).json()
|
||||||
except Exception as E: # noinspection PyBroadException
|
except Exception as E: # noinspection PyBroadException
|
||||||
@@ -139,7 +147,7 @@ def check_update_release(
|
|||||||
|
|
||||||
version_content = code_content["release"]["tag"]["name"]
|
version_content = code_content["release"]["tag"]["name"]
|
||||||
|
|
||||||
logger.info("已获取 {} 新版本信息:{}".format(appname,version_content))
|
logger.info("已获取 {} 新版本信息:{}".format(appname, version_content))
|
||||||
|
|
||||||
if is_ver_bigger(
|
if is_ver_bigger(
|
||||||
[int(v) for v in cut_ver_str(version_content).split(".")],
|
[int(v) for v in cut_ver_str(version_content).split(".")],
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
伶伦转换器 HTML页组件
|
伶伦转换器 HTML页组件
|
||||||
Linglun Converter HTML Component
|
Linglun Converter HTML Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
伶伦转换器 言论版组件
|
伶伦转换器 言论版组件
|
||||||
Linglun Converter Yan Lun Component
|
Linglun Converter Yan Lun Component
|
||||||
|
|
||||||
版权所有 © 2024 金羿 & 睿乐开发组
|
版权所有 © 2025 金羿
|
||||||
Copyright © 2024 EillesWan & TriM Org.
|
Copyright © 2025 EillesWan
|
||||||
|
|
||||||
开源相关声明请见 ./License.md
|
开源相关声明请见 仓库根目录下的 License.md
|
||||||
Terms & Conditions: ./Lisense.md
|
Terms & Conditions: License.md in the root directory
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@@ -25,20 +25,25 @@ yanlun_bg_colour = STANDART_BLACK
|
|||||||
logger.info("获取 言·论 信息……")
|
logger.info("获取 言·论 信息……")
|
||||||
|
|
||||||
solar_datetime = zhDateTime.DateTime.now()
|
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)
|
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):
|
if solar_date == (4, 3):
|
||||||
yanlun_texts = ["金羿ELS 生日快乐~!"]
|
yanlun_texts = ["金羿ELS 生日快乐~!", "Happy Birthday, Eilles!"]
|
||||||
elif solar_date == (8, 6):
|
elif solar_date == (8, 6):
|
||||||
yanlun_texts = ["诸葛八卦 生日快乐~!"]
|
yanlun_texts = ["诸葛亮与八卦阵 生日快乐~!", "Happy Birthday, bgArray~!"]
|
||||||
|
elif solar_date == (8, 16):
|
||||||
|
yanlun_texts = ["鱼旧梦 生日快乐~!", "Happy Birthday, ElapsingDreams~!"]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
yanlun_texts = (
|
yanlun_texts = (
|
||||||
requests.get(
|
requests.get(
|
||||||
"https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt",
|
"https://nd.liteyuki.icu/api/v3/share/content/Xpue?path=null",
|
||||||
)
|
)
|
||||||
.text.strip("\n")
|
.text.strip("\n")
|
||||||
.split("\n")
|
.split("\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user