慢慢更新。

This commit is contained in:
EillesWan 2022-03-24 01:01:45 +08:00
parent 245e2fa1ec
commit 26ec42a71d
14 changed files with 73 additions and 97 deletions

3
.idea/.gitignore vendored
View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>

View File

@ -1,47 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="LongLine" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyArgumentEqualDefaultInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyAugmentAssignmentInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="false" level="WARNING" enabled_by_default="false">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="3.10" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMandatoryEncodingInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E501" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N803" />
<option value="N806" />
<option value="N813" />
<option value="N801" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnboundLocalVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="list.__getitem__" />
<option value="list.split" />
</list>
</option>
</inspection_tool>
</profile>
</component>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Musicreater.iml" filepath="$PROJECT_DIR$/.idea/Musicreater.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,4 +0,0 @@
{
"esbonio.sphinx.confDir": "",
"python.formatting.provider": "autopep8"
}

View File

@ -58,15 +58,21 @@ except:
pass
from msctLib.log import log
def __loadLanguage(languageFilename: str):
with open(languageFilename, 'r', encoding='utf-8') as languageFile:
_text = {}
for line in languageFile:
if line.startswith('#'):
continue
line = line.split(' ', 1)
_text[line[0]] = line[1].replace('\n', '')
langkeys = _text.keys()
with open(languageFilename.replace(languageFilename[-10:-5], 'zh-CN'), 'r', encoding='utf-8') as defaultLangFile:
for line in defaultLangFile:
if line.startswith('#'):
continue
line = line.split(' ', 1)
if not line[0] in langkeys:
_text[line[0]] = line[1].replace('\n', '')
@ -90,7 +96,6 @@ def wordTranslate(singleWord: str, debug: bool = False):
requests.post('https://fanyi.baidu.com/sug', data={'kw': f'{singleWord}'}).json()['data'][0]['v'].split(
'; ')[0]
except:
from msctLib.log import log
log(f"无法翻译文本{singleWord}", level='WARRING', isPrinted=debug)
return None
@ -102,7 +107,8 @@ def _(text: str, debug: bool = False):
if debug:
raise KeyError(f'无法找到翻译文本{text}')
else:
return None
log(f'无法找到本地化文本{text}','ERROR')
return ''
if __name__ == '__main__':
@ -148,8 +154,6 @@ if __name__ == '__main__':
root.geometry('600x500')
root.bind_all(func=_autoSave)
root.bind("<Motion>", _autoSave)
nowText = ''

View File

@ -1,4 +1,12 @@
# 音·创 本地化语言文件
# 使用 空格 把键与对应文本隔开
# 使用 井字符 在每一行的开头编写注释
# 注意!井字符请开头放,切勿含有空格
# 或者在正文结尾放!
LANGKEY zh-CN
LANGCHINESENAME 简体中文 中国大陆
LANGENGLIFHNAME Simplified Chinese, Chinese Mainland
LANGLOCALNAME 简体中文 中国大陆
MSCT 音·创
F音创 音·创 Musicreater
关于 音·创 - 关于

BIN
msctLib/bugExecution.exe Normal file

Binary file not shown.

50
msctLib/buildIN.py Normal file
View File

@ -0,0 +1,50 @@
# -*- coding: UTF-8 -*-
"""音·创的核心内置组件功能集合"""
class version:
libraries = (
'mido', 'amulet', 'amulet-core', 'amulet-nbt', 'piano_transcription_inference', 'pypinyin',
'pyinstaller', 'py7zr','websockets', 'torch', 'requests'
)
"""当前所需库"""
version = ('0.2.0', 'Delta',)
"""当前版本"""
def __init__(self) -> None:
self.libraries = version.libraries
"""当前所需库"""
self.version = version.version
"""当前版本"""
def installLibraries(self,index:str = 'https://pypi.tuna.tsinghua.edu.cn/simple'):
"""安装全部开发用库"""
from sys import platform
import os
if platform == 'win32':
import shutil
try:
shutil.rmtree(os.getenv('APPDATA') + '\\Musicreater\\')
except FileNotFoundError:
pass
for i in self.libraries:
print("安装库:" + i)
os.system(f"python -m pip install {i} -i {index}")
elif platform == 'linux':
os.system("sudo apt-get install python3-pip")
os.system("sudo apt-get install python3-tk")
os.system("sudo apt-get install python3-tkinter")
for i in self.libraries:
print("安装库:" + i)
os.system(f"sudo python3 -m pip install {i} -i {index}")
def __call__(self):
'''直接安装库,顺便返回一下当前版本'''
self.installLibraries()
return self.version

View File

@ -172,13 +172,13 @@ class disp:
def authorMenu(authors: tuple = (('金羿', 'EillesWan@outlook.com'), ('诸葛亮与八卦阵', '474037765'))):
'''自定义作者界面'''
from languages.lang import _
aabw = tk.Tk()
aabw.title(_('关于'))
aabw.geometry('550x600') # 像素
tk.Label(aabw, text='', font=('', 15)).pack()
tk.Label(aabw, text=READABLETEXT[10], font=('', 35)).pack()
tk.Label(aabw, text=READABLETEXT[11].format(
VER[1] + VER[0]), font=('', 15)).pack()
tk.Label(aabw, text=_('F音创'), font=('', 35)).pack()
tk.Label(aabw, text='{} {}'.format(VER[1] + VER[0]), font=('', 15)).pack()
# pack 的side可以赋值为LEFT RTGHT TOP BOTTOM
# grid 的row 是列数、column是行排注意这是针对空间控件本身大小来的即是指向当前控件的第几个。
# place的 x、y是(x,y)坐标

View File

@ -95,3 +95,7 @@ A man achieve with challenges.
乘风破浪,勇往直前。
时间的长河会见证过往的一切
风沙的吹拂会证明遗失的散漠
深冷的面具下埋藏着颤抖的心
苦痛的旅程中盘错着举世的谎言
欲落的花会告诉你我无尽的思念,而风会在此刻替我拥抱住你。 ——蝶<1361223398>
仰望这深邃的夜空,明星洒下的光,总是无尽斑驳