mirror of
https://github.com/TriM-Organization/Linglun-Converter.git
synced 2024-12-01 09:34:53 +08:00
准备尝试新事物
This commit is contained in:
parent
eaefb6f987
commit
264d1ec11c
@ -13,13 +13,17 @@ Terms & Conditions: ./Lisense.md
|
|||||||
|
|
||||||
|
|
||||||
# 导入所需库
|
# 导入所需库
|
||||||
import datetime
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import urllib.error
|
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
|
if sys.argv:
|
||||||
|
if "-l" in sys.argv:
|
||||||
|
pass # 更换语言
|
||||||
|
elif "--edit-lang" in sys.argv:
|
||||||
|
from utils.localize import main
|
||||||
|
main()
|
||||||
|
exit()
|
||||||
|
|
||||||
import Musicreater
|
import Musicreater
|
||||||
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
from Musicreater.constants import DEFAULT_PROGRESSBAR_STYLE
|
||||||
@ -33,7 +37,7 @@ from Musicreater.plugin.bdxfile import to_BDX_file_in_delay, to_BDX_file_in_scor
|
|||||||
|
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
from utils.io import myWords, osc, logger, object_constants, TrimLog, is_logging
|
from utils.io import myWords, logger, object_constants # , TrimLog, is_logging
|
||||||
from utils.update_check import check_update
|
from utils.update_check import check_update
|
||||||
|
|
||||||
|
|
||||||
@ -45,22 +49,20 @@ __appname__ = "伶伦转换器"
|
|||||||
__version__ = "WXGUI 0.0.3"
|
__version__ = "WXGUI 0.0.3"
|
||||||
__zhver__ = "WX图形界面 预代预版第三次修订"
|
__zhver__ = "WX图形界面 预代预版第三次修订"
|
||||||
|
|
||||||
osc.project_name = __appname__
|
|
||||||
osc.version = __version__
|
|
||||||
|
|
||||||
|
|
||||||
# osc = object_constants.ObjectStateConstant(
|
|
||||||
# logging_project_name=__appname__,
|
|
||||||
# logging_project_version=__version__,
|
|
||||||
# logging_exit_exec=lambda x: None,
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
osc = object_constants.ObjectStateConstant(
|
||||||
|
logging_project_name=__appname__,
|
||||||
|
logging_project_version=__version__,
|
||||||
|
logging_exit_exec=lambda x: None,
|
||||||
|
)
|
||||||
|
logger.printing = not osc.is_release
|
||||||
|
|
||||||
|
|
||||||
yanlun_length = len(myWords)
|
yanlun_length = len(myWords)
|
||||||
|
|
||||||
logger.info("加载窗口布局……")
|
logger.info("加载窗口布局……")
|
||||||
|
|
||||||
|
|
||||||
# 创建应用程序类
|
# 创建应用程序类
|
||||||
class LinglunConverterApp(wx.App):
|
class LinglunConverterApp(wx.App):
|
||||||
def OnInit(self):
|
def OnInit(self):
|
||||||
@ -959,7 +961,19 @@ logger.info("执行应用。")
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = LinglunConverterApp()
|
app = LinglunConverterApp()
|
||||||
|
|
||||||
check_update(__appname__,"https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/llc_win_wxPython.py",__version__,lambda text:wx.MessageDialog(None,text,"软件更新",wx.ICON_INFORMATION | wx.YES_DEFAULT,).ShowModal(),logger,__zhver__)
|
check_update(
|
||||||
|
__appname__,
|
||||||
|
"https://gitee.com/TriM-Organization/Linglun-Converter/raw/master/llc_win_wxPython.py",
|
||||||
|
__version__,
|
||||||
|
lambda text: wx.MessageDialog(
|
||||||
|
None,
|
||||||
|
text,
|
||||||
|
"软件更新",
|
||||||
|
wx.ICON_INFORMATION | wx.YES_DEFAULT,
|
||||||
|
).ShowModal(),
|
||||||
|
logger,
|
||||||
|
__zhver__,
|
||||||
|
)
|
||||||
|
|
||||||
app.MainLoop()
|
app.MainLoop()
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
Musicreater>=1.0.0
|
Musicreater>=1.6.0
|
||||||
TrimLog>=0.7.2
|
TrimLog>=0.8.3
|
||||||
|
28
utils/io.py
28
utils/io.py
@ -14,20 +14,30 @@ Terms & Conditions: ./Lisense.md
|
|||||||
|
|
||||||
import urllib.error
|
import urllib.error
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from typing import Any, Callable, Dict, List, Literal, Optional, Set, TextIO, Tuple, Iterable, Sequence
|
from typing import (
|
||||||
|
Any,
|
||||||
|
Callable,
|
||||||
|
Dict,
|
||||||
|
List,
|
||||||
|
Literal,
|
||||||
|
Optional,
|
||||||
|
Set,
|
||||||
|
TextIO,
|
||||||
|
Tuple,
|
||||||
|
Iterable,
|
||||||
|
Sequence,
|
||||||
|
)
|
||||||
|
|
||||||
import TrimLog
|
import TrimLog
|
||||||
from TrimLog import Console, object_constants
|
from TrimLog import object_constants, logger
|
||||||
|
|
||||||
is_logging: bool = True
|
is_logging: bool = True
|
||||||
|
|
||||||
MainConsole = Console()
|
MainConsole = logger.console
|
||||||
osc = object_constants.ObjectStateConstant()
|
|
||||||
logger = TrimLog.Logger(
|
logger.is_logging = True
|
||||||
is_logging=is_logging,
|
logger.suffix = ".llc"
|
||||||
# printing=not osc.is_release,
|
logger.is_tips = True
|
||||||
in_suffix=".llc",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
31
utils/localize.py
Normal file
31
utils/localize.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
伶伦转换器 本地化组件
|
||||||
|
Linglun Converter Language Localization Component
|
||||||
|
|
||||||
|
版权所有 © 2023 金羿 & 睿穆开发组
|
||||||
|
Copyright © 2023 EillesWan & TriM Org.
|
||||||
|
|
||||||
|
开源相关声明请见 ./License.md
|
||||||
|
Terms & Conditions: ./Lisense.md
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .io import TrimLog, urllib, Sequence, Iterable, Callable, Optional
|
||||||
|
|
||||||
|
def unpack_language_pack():
|
||||||
|
pass
|
||||||
|
|
||||||
|
def enpack_language_pack():
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _() -> str:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def main():
|
||||||
|
pass
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
23
自我陶醉.py
Normal file
23
自我陶醉.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# -*- conding: utf8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
m = 0
|
||||||
|
|
||||||
|
for path, dir_list, file_list in os.walk(r"./"):
|
||||||
|
for file_name in file_list:
|
||||||
|
if file_name.endswith('.py'):
|
||||||
|
file = os.path.join(path, file_name)
|
||||||
|
print("得到文件名:" + str(file))
|
||||||
|
for i in open(file, 'r', encoding="utf-8"):
|
||||||
|
code = i.strip()
|
||||||
|
|
||||||
|
if code.startswith('#'):
|
||||||
|
pass
|
||||||
|
elif code:
|
||||||
|
print("\t" + code)
|
||||||
|
m += 1
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
input("\n最终代码行数为:" + str(m))
|
Loading…
Reference in New Issue
Block a user