def __autoUpdate(self): now = int(time.time()) if self.cfg['udrate'] == 1: updateTime = int(self.cfg['udtime']) + 86400 elif self.cfg['udrate'] == 2: updateTime = int(self.cfg['udtime']) + 86400 * 7 elif self.cfg['udrate'] == 3: updateTime = int(self.cfg['udtime']) + 86400 * 30 else : updateTime = int(self.cfg['udtime']) + 86400 * 7 if updateTime < now : Updater = updateClass.Update() info = Updater.check(self.appVer) self.CfgClass.lastUd(now) if info['update'] == True : self.slave = tkinter.Tk(); self.slave.title('Update') self.slave.resizable(width = 'false', height = 'false') label = tkinter.Label(self.slave, text = info['version'], font = ("Helvetica", "16", 'bold'), anchor = 'center') label.grid(row = 0, pady = 10) information = tkinter.Text(self.slave, height = 10, width = 60, highlightthickness = 0, font = ("Helvetica", "14")) information.grid(row = 1, padx = 10, pady = 5) information.insert('end', info['msg']); btn = tkinter.Button(self.slave, text = 'Download', width = 10, command = lambda target = info['dUrl'] : webbrowser.open_new(target)) btn.grid(row = 2, pady = 10)
def __chkUpdate (self) : Updater = updateClass.Update() info = Updater.check(self.appVer) self.slave = Tkinter.Tk(); self.slave.title('Update') self.slave.resizable(width = 'false', height = 'false') if info['update'] == True : label = Tkinter.Label(self.slave, text = info['version'], font = ("Helvetica", "16", 'bold'), anchor = 'center') label.grid(row = 0, pady = 10) information = Tkinter.Text(self.slave, height = 10, width = 60, highlightthickness = 0, font = ("Helvetica", "14")) information.grid(row = 1, padx = 10, pady = 5) information.insert('end', info['msg']); btn = Tkinter.Button(self.slave, text = 'Download', width = 10, command = lambda target = info['dUrl'] : webbrowser.open_new(target)) btn.grid(row = 2, pady = 10) else : label = Tkinter.Label(self.slave, text = self.version, font = ("Helvetica", "16", 'bold'), anchor = 'center') label.grid(row = 0, pady = 10) label = Tkinter.Label(self.slave, height = 3, width = 60, text = info['msg'], font = ("Helvetica", "14"), anchor = 'center') label.grid(row = 1, pady = 10) now = int(time.time()) self.CfgClass.lastUd(now)