1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| def patcher() : #patch bouton
global resultat
if hostuse =="True" :
hostedit()
if copyFuse =="True" :
loader.start()
copypaste.start()
elif copyFuse =="False" :
print "False Copy"
elif hostuse =="False" :
if copyFuse =="True" :
loader.start()
copypaste.start()
elif copyFuse =="False" :
print "False All"
resultat = Label(fenetre, text='Error : Check config.ini',fg='red')
resultat.grid(row=1,column=1)
else :
resultat = Label(fenetre, text='Error : Check config.ini',fg='red')
resultat.grid(row=1,column=1)
#option- Patch #################################################
def copywait():
global resultat
resultat = Label(fenetre, text='Attendez...',fg='black')
resultat.grid(row=1,column=1)
def copycopy(src, dst, srcbackup):
global resultat
l = glob.glob(src+'\\*')
for i in l:
if os.path.isdir(i): copycopy(i, dst, srcbackup)
else:
try: os.makedirs(os.path.dirname(dst + os.sep + i[len(srcbackup)+1:]))
except: pass
shutil.copyfile(i, dst + os.sep + i[len(srcbackup)+1:])
try : resultat.destroy()
except : pass
resultat = Label(fenetre, text='Patché !',fg='green')
resultat.grid(row=1,column=1)
#Thread ########################################################
loader = threading.Thread(None, lambda: copywait(), None)
copypaste = threading.Thread(None, lambda: copycopy("file",gameloc2,"file"), None) |
Partager