From 38463871a1a81676cf0178627ddcef63e5ebc1fd Mon Sep 17 00:00:00 2001 From: Bigsk Date: Sun, 15 Nov 2020 12:30:26 +0800 Subject: [PATCH] Some small updates :) --- main.py | 28 ++++++++++++++++++++++--- old/0.1.0/logs/2020-08-19-1.log.gz | Bin 763 -> 0 bytes old/0.1.0/logs/2020-08-19-17-17-44.txt | 9 -------- old/0.1.0/logs/2020-08-19-17-18-15.txt | 9 -------- old/0.1.0/logs/2020-08-19-17-18-39.txt | 10 --------- old/0.1.0/logs/2020-08-19-17-18-41.txt | 10 --------- old/0.1.0/logs/2020-08-19-17-18-42.txt | 16 -------------- old/0.1.0/logs/2020-08-19-18-14-35.txt | 10 --------- old/0.1.0/logs/2020-08-19-18-14-37.txt | 10 --------- old/0.1.0/logs/2020-08-19-18-14-38.txt | 18 ---------------- old/0.1.0/logs/latest.log | 13 ------------ 11 files changed, 25 insertions(+), 108 deletions(-) delete mode 100644 old/0.1.0/logs/2020-08-19-1.log.gz delete mode 100644 old/0.1.0/logs/2020-08-19-17-17-44.txt delete mode 100644 old/0.1.0/logs/2020-08-19-17-18-15.txt delete mode 100644 old/0.1.0/logs/2020-08-19-17-18-39.txt delete mode 100644 old/0.1.0/logs/2020-08-19-17-18-41.txt delete mode 100644 old/0.1.0/logs/2020-08-19-17-18-42.txt delete mode 100644 old/0.1.0/logs/2020-08-19-18-14-35.txt delete mode 100644 old/0.1.0/logs/2020-08-19-18-14-37.txt delete mode 100644 old/0.1.0/logs/2020-08-19-18-14-38.txt delete mode 100644 old/0.1.0/logs/latest.log diff --git a/main.py b/main.py index 90c4598..d55d7de 100644 --- a/main.py +++ b/main.py @@ -26,13 +26,16 @@ class GMCLCore(object): self.__GamePath=GamePath self.__Version=Version ''' - def __init__(self,LauncherName="GMCLCore",LauncherVersion="A0.2.0"): + def __init__(self,LauncherName="GMCLCore",LauncherVersion="A0.2.0",LogOutput=False): '''The global variable set function''' - ''':LauncherName The name of your launcher,default value is "GMCLCore".''' - ''':LauncherVersion The version of your launcher,default value is the version of core.''' + ''':LauncherName The name of your launcher,the default value is "GMCLCore"''' + ''':LauncherVersion The version of your launcher,the default value is the version of core''' + ''':LogOutput The switch of the log output function,the default value is False''' self.__LauncherName=LauncherName self.__LauncherVersion=LauncherVersion + self.__LogOutput=LogOutput self.__UserAgent={'User-Agent':LauncherName+'/'+LauncherVersion+' ((GMCL Core Alpha 0.2.0;Alpha))'} + self.__Log=[] def SearchFile(self,Path,Tag,Num=1): '''The function which was used to search files''' ''':Path The root path you want to search''' @@ -49,6 +52,25 @@ class GMCLCore(object): else: pass return List + def MakeDir(self,Path): + '''The function which was used to create a dir with determination''' + ''':Path The path of the dir you want to create''' + if(os.path.isdir(Path)==False): + os.mkdir(Path) + def Log(self,Type,Text): + '''The function which was used to manager the log output system''' + ''':Type Type of the log info''' + ''':Text The main text of log info''' + if(Text!="" or None): + if(Type=="info"): + self.__Log.append(("INFO",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text)) + elif(Type=="warn"): + self.__Log.append(("WARN",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text)) + elif(Type=="error"): + self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text)) + else: + self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Text)) + return Text def GetUUID(self,Account="Steve"): '''The function which was used to generate UUID''' ''':Account Your account,the default value is "Steve"''' diff --git a/old/0.1.0/logs/2020-08-19-1.log.gz b/old/0.1.0/logs/2020-08-19-1.log.gz deleted file mode 100644 index 935f7f847ed9633c6e415d829b2904fd85627a2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 763 zcmVYuhjseqLe!;SBbWK&x6#oQq#ducITEl62ccC`GXq zN3ARcNzP>t`|XqM=F&E9!`Qwj=Y{w?j&O#?xZjGNk3Vq1_1;r!8R1O=!504t}Sk z8@1|>&R{VUG*Dz@{A{j|Njyy3dTb|D&4{tF>*0OA8c-yoX!l+7H7X*z8R)dDblH!l z?>I$gd2S~b=>vA$>fFOF7&Liy31a#+slr2YI`063#7=nthlFCL3`dK3ut#QpcKmx#VSEFsd#A5@_|eV z;zUH~nsXWveyXA*w%nKVfKE&%^QRRU5>0J#!I&r#*nR^!_&^L~6p3LRon?T}7c{U! zQ7Fv*ozge)DCA6}jkby}!>_@Kk5L0T_qguf?ZUAOMGzAdm2$w9)vNDfw+sV}a0R*O zfhhlE4J4aDT&->gj-%(midTT+FK|t~8xS`OcINXJjM&)@G>hlJdb6PDkwL*Gu;CRj zTHuRfwpT5vL96?Tf=rMoCQP7q`bbCbHF>G%>K`iFJ#%kM=>yI?WhgaKAW#lK(U^%x zWOMYfgB@qD^u5ym1*O;a@9w>#_ln-XyZ1`}@04CIbOKV?4KgogBs8`u86AS_d9_;p z74JIs_gC3o-@>J1&CCOMbqpk&5^IjqYok|@nLFC(E|> tl^fkT{4_CRY5nkxb;HoIj_wd