def update(self): print 'Checking for new update...' versionfile = self.netopen('/'+common.CONFIG_VERSIONFILE) print "Show Server Version Message:" print versionfile oldsha1 = self.old_file_sha1_ini path = common.CONFIG_SHA1+'.tmp' FileUtil.if_has_file_remove(path) self.getnewsha1(path,oldsha1) newsha1 = Config(path) for path, sha1v in newsha1.getsection('FILE_SHA1'): if not (sha1v == oldsha1.getconfig('FILE_SHA1',path)): oldpath = path path = path.replace('$path$','') path = path.replace('\\','/') self.writefile(path,sha1v) FileUtil.if_has_file_remove(path) print 'Finished Update' print 'Cleaning DIR' self.cleandir() print 'Finished Clean'
def update(self): print "Checking for new update..." versionfile = self.netopen("/" + common.CONFIG_VERSIONFILE) print "Show Server Version Message:" print versionfile oldsha1 = self.old_file_sha1_ini path = common.CONFIG_SHA1 + ".tmp" FileUtil.if_has_file_remove(path) self.getnewsha1(path, oldsha1) newsha1 = Config(path) for path, sha1v in newsha1.getsection("FILE_SHA1"): if not (sha1v == oldsha1.getconfig("FILE_SHA1", path)): oldpath = path path = path.replace("$path$", "") path = path.replace("\\", "/") self.writefile(path, sha1v) FileUtil.if_has_file_remove(path) print "Finished Update" print "Cleaning DIR" self.cleandir() print "Finished Clean"
def cleandir(self): needclean = Config(common.CONFIG_NEEDCLEAN) for path, sha1v in needclean.getsection('NEEDCLEAN'): path = path.replace('\\','/') path = path.replace('$path$/','') FileUtil.if_has_file_remove(path,showinfo = True)
def cleandir(self): needclean = Config(common.CONFIG_NEEDCLEAN) for path, sha1v in needclean.getsection("NEEDCLEAN"): path = path.replace("\\", "/") path = path.replace("$path$/", "") FileUtil.if_has_file_remove(path, showinfo=True)