diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index eaf91e2..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/Musicreater.iml b/.idea/Musicreater.iml deleted file mode 100644 index 2946dc0..0000000 --- a/.idea/Musicreater.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index ccecc23..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 8d93904..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index b125bed..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 9661ac7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9617d49..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "esbonio.sphinx.confDir": "", - "python.formatting.provider": "autopep8" -} \ No newline at end of file diff --git a/languages/lang.py b/languages/lang.py index 8d21b05..54ea3b7 100644 --- a/languages/lang.py +++ b/languages/lang.py @@ -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("", _autoSave) nowText = '' diff --git a/languages/zh-CN.lang b/languages/zh-CN.lang index 34edf24..bfbd30b 100644 --- a/languages/zh-CN.lang +++ b/languages/zh-CN.lang @@ -1,4 +1,12 @@ +# 音·创 本地化语言文件 +# 使用 空格 把键与对应文本隔开 +# 使用 井字符 在每一行的开头编写注释 +# 注意!井字符请开头放,切勿含有空格 +# 或者在正文结尾放! LANGKEY zh-CN LANGCHINESENAME 简体中文 中国大陆 LANGENGLIFHNAME Simplified Chinese, Chinese Mainland LANGLOCALNAME 简体中文 中国大陆 +MSCT 音·创 +F音创 音·创 Musicreater +关于 音·创 - 关于 diff --git a/msctLib/bugExecution.exe b/msctLib/bugExecution.exe new file mode 100644 index 0000000..99ba600 Binary files /dev/null and b/msctLib/bugExecution.exe differ diff --git a/msctLib/buildIN.py b/msctLib/buildIN.py new file mode 100644 index 0000000..3bcf8a8 --- /dev/null +++ b/msctLib/buildIN.py @@ -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 diff --git a/msctLib/display.py b/msctLib/display.py index a517f14..87156db 100644 --- a/msctLib/display.py +++ b/msctLib/display.py @@ -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)坐标 diff --git a/resources/myWords.txt b/resources/myWords.txt index f2a721d..c9f94a0 100644 --- a/resources/myWords.txt +++ b/resources/myWords.txt @@ -95,3 +95,7 @@ A man achieve with challenges. 乘风破浪,勇往直前。 时间的长河会见证过往的一切 风沙的吹拂会证明遗失的散漠 +深冷的面具下埋藏着颤抖的心 +苦痛的旅程中盘错着举世的谎言 +欲落的花会告诉你我无尽的思念,而风会在此刻替我拥抱住你。 ——蝶<1361223398> +仰望这深邃的夜空,明星洒下的光,总是无尽斑驳