#! /usr/bin/env python#-*- coding:utf-8 -*-""""@Author :[email protected] :[email protected] """"import configimport osimport shutilclass bypass(): def_init_(self, steamapps_path): self.steamapps path=steamappspath self.pubg_path =steamapps path+PUBG self.bypass path =steamapps path+bypass if not os.path.exists(self.bypass path): l('Info',unicode('正在初始化"utf-8').encode("gbk')) shutil.copytree(self.pubg pathselfbypass path) #step 1 shutil.move(self.pubg_path,self.steamapps_path +'PUBG1) #step 2 l('Info',unicode('初始化完成',utf-8').encode('gbk)) def make link(self,): pubg pak path =self.pubg path+\Ts1Game Content\PaksTsGame-WindowsNoEditor uil.pak l('Info',unicode('正在創建軟鏈接''utf-8').encode(gbk')) os.popen('mklink /j"'+ self.pubg path +…'""'+ self.bypass path +'"') #step 3 os.popen('mklink"'+ pubg_pak_path+'""'+config.FUNC_PAK_PATH+'"') #step 4 l('Info',unicode('軟鏈接創建成功','utf-8').encode('gbk')) def clean(self,): bypass pak path=self.bypass_path+1\Ts1Game\Content\\Paks\Ts1Game-WindowsNoEditor ui1.pak l('Info',unicode('正在過檢測','utf-8').encode('gbk')) os.remove(bypass pak path) #step 5 os.popen('rd /s /q"' +self.pubg_path +'"') #step 6 shutil.move(self.steamapps_path+'PUBG1selfpubg path) #step 7 l('Info',unicode(成功過檢測開始奔放吧,utf-8').encode('gbk'))def l(s,message): print'[%s] %s'%(s,message)def main(): steamapps path=config.STEAM PATH+'steamapps\\common'! if os.path.exists(steamapps_path +PUBG): obj=bypass(steamapps_path) obj.make link() l('Info',unicode('上飛機後切回來按任意鍵開始過檢測','utf-8').encode(gbk)) os.system('pause') obj.clean() else: l('Warning',unicode('請檢責配置文件中的游戲目錄是否正確','utf-8')encode('gbk))if__name__' __main__ ': main()
求改錯!