准备尝试新事物

This commit is contained in:
EillesWan 2024-01-08 00:10:17 +08:00
parent eaefb6f987
commit 264d1ec11c
5 changed files with 103 additions and 25 deletions

View File

@ -13,13 +13,17 @@ Terms & Conditions: ./Lisense.md
# 导入所需库
import datetime
import os
import random
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
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
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
@ -45,22 +49,20 @@ __appname__ = "伶伦转换器"
__version__ = "WXGUI 0.0.3"
__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)
logger.info("加载窗口布局……")
# 创建应用程序类
class LinglunConverterApp(wx.App):
def OnInit(self):
@ -959,7 +961,19 @@ logger.info("执行应用。")
if __name__ == "__main__":
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()

View File

@ -1,2 +1,2 @@
Musicreater>=1.0.0
TrimLog>=0.7.2
Musicreater>=1.6.0
TrimLog>=0.8.3

View File

@ -14,20 +14,30 @@ Terms & Conditions: ./Lisense.md
import urllib.error
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
from TrimLog import Console, object_constants
from TrimLog import object_constants, logger
is_logging: bool = True
MainConsole = Console()
osc = object_constants.ObjectStateConstant()
logger = TrimLog.Logger(
is_logging=is_logging,
# printing=not osc.is_release,
in_suffix=".llc",
)
MainConsole = logger.console
logger.is_logging = True
logger.suffix = ".llc"
logger.is_tips = True
try:

31
utils/localize.py Normal file
View 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
View 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))