I had back to school now :(

This commit is contained in:
Bigsk 2020-11-15 15:54:41 +08:00
parent 38463871a1
commit 911dc18ca7

46
main.py
View File

@ -36,6 +36,31 @@ class GMCLCore(object):
self.__LogOutput=LogOutput
self.__UserAgent={'User-Agent':LauncherName+'/'+LauncherVersion+' ((GMCL Core Alpha 0.2.0;Alpha))'}
self.__Log=[]
def Log(self,Type,Text,Function="Anonymous Function"):
'''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()),Function,Text))
return ("INFO",Text)
elif(Type=="warn"):
self.__Log.append(("WARN",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
return ("WARN",Text)
elif(Type=="error"):
self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
return ("ERROR",Text)
else:
self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
return ("OTHER",Text)
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)
return self.Log("info","Successful.","MakeDir")
else:
return self.Log("warn","Exist.","MakeDir")
def SearchFile(self,Path,Tag,Num=1):
'''The function which was used to search files'''
''':Path The root path you want to search'''
@ -52,25 +77,6 @@ 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"'''
@ -183,4 +189,4 @@ class GMCLCore(object):
t.start()
mtd_list.append(t)
for i in mtd_list:
i.join()
i.join()