def checkupdate(self): '''Checks for update''' self.title('Checking for updates...') ver, log = checkupdate() if ver: self.title('Update found!') if ask.askyesno('A new update is available!', 'Update %s is available (you are on %s.) Download? In this update:\n%s' % (ver, version, log)): web('https://github.com/yunruse/Steam-Mover/') else: self.title('No updates found')
def openInfosite(self): try: FullVerInfo = self.master.TF3.get().replace(' ', '') if FullVerInfo: showinfo('Information', DownloadInfo) VerInfo = FullVerInfo.split(',')[0] version = VerInfo.split('.')[0] osbuild = VerInfo.split('B')[1] model = FullVerInfo.split(',')[1] Fullmodel = model.split('_')[0] model_dict = getJsonData( join(dirname(ImagePath), 'models.json')) Fullmodel = model_dict[Fullmodel] web('https://info.fortinet.com/files/{0}/v{1}.00/images/build{2}/{3}-v{1}-build{2}-FORTINET.out' .format(Fullmodel, version, osbuild, model)) else: showerror( 'ERROR', 'Please select TP request form,\nsuch as \"04-TP-REQUEST-REQUEST FORM-FAZ-XXXE.docx\"' ) except IOError as ioerr: pass self.master.displayText["text"] = str(ioerr) showerror('ERROR', str(ioerr))
def on_bug(self, *args): web("https://github.com/avernusheros/avernus/issues")
def on_website(self, *args): web("https://github.com/avernusheros/avernus")
def on_help(self, *args): # unused web("https://answers.launchpad.net/avernus")
def tab(self,file='t.html'): with open(file,'w') as f:f.write(self.dr.page_source) sleep(1) ; web(file)
except Exception as e: e = traceback.format_exc() sg.popup_scrolled(e, title="Unknown Error") elif event == "c_login": login_window["col1"].update(visible=False) login_window["col2"].update(visible=True) access_token = config["access_token"] client_id = config["client_id"] login_window["access_token"].update(value=access_token) login_window["client_id"].update(value=client_id) elif event == "Github": web("https://github.com/techtanic/Discounted-Udemy-Course-Enroller" ) elif event == "Support": web("https://techtanic.github.io/ucg/") elif event == "Discord": web("https://discord.gg/wFsfhJh4Rh") elif event == "Back": login_window["col1"].update(visible=True) login_window["col2"].update(visible=False) elif event == "Login": access_token = values["access_token"] client_id = values["client_id"]
def check_update(): web("https://virtual-robo.github.io/VirtualLine/update/?%s" % version)
def __init__(self): self.window = window = tk.Tk() window.resizable(0,1) window.minsize(600,300) window.protocol('WM_DELETE_WINDOW', self.close) window.grid_rowconfigure(3, weight=1) #Path entry boxes ltype = tk.Entry(window, width=50) rtype = tk.Entry(window, width=50) ltype.bind('<Return>', lambda e: thread(self.getlibrary,'l')) rtype.bind('<Return>', lambda e: thread(self.getlibrary,'r')) ltype.grid(row=0) rtype.grid(row=0,column=1, columnspan=3) ltype.insert(0, defaultleft) rtype.insert(0, defaultright) #Sizing labels llab = tk.Label(window) rlab = tk.Label(window) llab.grid(row=1) rlab.grid(row=1,column=1, columnspan=3) #Canvases for size lbar = tk.Canvas(window, height=20, width=300) rbar = tk.Canvas(window, height=20, width=300) lbar.grid(row=2) rbar.grid(row=2,column=1, columnspan=3) self.showdrives = True #Lists of games llis = tk.Listbox(window, width=50) rlis = tk.Listbox(window, width=50) llis.grid(row=3, sticky='ns') rlis.grid(row=3, column=1, sticky='ns', columnspan=3) llis.bind('<Double-Button-1>', lambda e: thread(self.select, 'l')) rlis.bind('<Double-Button-1>', lambda e: thread(self.select, 'r')) #Information label info = tk.Label(window, text='No game selected. Double-click one from either library.', width=42) info.grid(row=4, rowspan=2) #Buttons bcopy = tk.Button(window, text='Copy', command = lambda: thread(self.op, 'Copy'), state='disabled') bcopy.grid(row=4, column=1, sticky='nwe') bmove = tk.Button(window, text='Move', command = lambda: thread(self.op, 'Move'), state='disabled') bmove.grid(row=4, column=2, sticky='nwe') bdel = tk.Button(window, text='Delete', command = lambda: thread(self.op, 'Delete'), state='disabled') bdel.grid(row=4, column=3, sticky='nwe') btool = tk.Button(window, text='Tools...', command = self.tools, state='disabled') btool.grid(row=5, column=1, sticky='nwe') bopen = tk.Button(window, text='Open folder', command = lambda: os.startfile( os.path.join(self.srclib['path'], 'common', self.sources[self.game]['path']) ), state='disabled') bopen.grid(row=5, column=2, sticky='nwe') bplay = tk.Button(window, text='Play game', command = lambda: web('steam://run/%s' % self.game), state='disabled') bplay.grid(row=5, column=3, sticky='nwe') self.drivewin = DriveClean(self) #Menu bar menu = tk.Menu(window, tearoff=0) def updateboth(): self.getlibrary('l') self.getlibrary('r') menu.add_command(label='Refresh libraries', command = lambda: thread(updateboth)) menu.add_command(label='Check for updates', command = lambda: thread(self.checkupdate)) menu.add_command(label='Library Cleaner...', command = self.drivewin.show) menu.add_command(label='Toggle drive display', command = self.toggledrive) menu.add_command(label='About...', command = lambda: ask.showinfo('Steam Mover version %s' % version, 'Copyright © 2016 Ami yun Ruse @yunruse. See LICENSE for legal stuff.')) window.config(menu=menu) #Tools menu popup popup = tk.Menu(window, tearoff=0) popup.add_command(label='Details in Steam', command = lambda: web('steam://nav/games/details/%s' % self.game)) popup.add_command(label='Verify cache', command = lambda: web('steam://validate/%s' % self.game)) popup.add_command(label='Backup to file...', command = lambda: web('steam://backup/%s' % self.game)) visit = tk.Menu(popup, tearoff=0) visit.add_command(label='SteamDB stats', command = lambda: web('https://steamdb.info/app/%s' % self.game)) visit.add_command(label='Store page', command = lambda: web('steam://url/StoreAppPage/%s' % self.game)) visit.add_command(label='Game hub', command = lambda: web('steam://url/GameHub/%s' % self.game)) visit.add_command(label='News page', command = lambda: web('steam://appnews/%s' % self.game)) popup.add_cascade(label='Visit...', menu=visit) self.ltype = ltype self.rtype = rtype self.llab = llab self.rlab = rlab self.lbar = lbar self.rbar = rbar self.llis = llis self.rlis = rlis self.info = info self.popup = popup self.bcopy = bcopy self.bmove = bmove self.bdel = bdel self.bopen = bopen self.bplay = bplay self.btool = btool self.srclib = self.game = self.dstlib = False #In case of preëmptive checks self.operation = False self.sources = {} thread(self.getnames) thread(self.getlibrary('l')) thread(self.getlibrary('r')) self.loop = window.mainloop
def initUI(self, alog): # Massive function that prepares the ui, defines data, and connects slots. self.data = None # Initialize save data var to null. self.alog = alog # Advanced logging. # Default data structure to use in case loaded data is missing flags. # Note: None values should not be set in data or default_data! None should only be used to default GUI widgets! # These defaults are educated guesses and may not be accurate, so no harm in altering them. self.default_data = { 'player': { 'name': "", 'acc1': "", 'acc2': "", 'botarm': "", 'toparm': "", 'toy': "", 'wep': "", 'dex': 0, 'dexG': 1, 'inte': 0, 'inteG': 1, 'lib': 0, 'libG': 1, 'sta': 0, 'staG': 1, 'str': 0, 'strG': 1, 'spi': 0, 'spiG': 1, 'maxLust': 10, 'maxLustG': 5, 'curLust': 0, 'maxHp': 10, 'maxHpG': 10, 'curHp': 140, 'maxSp': 10, 'maxSpG': 5, 'curSp': 90, 's**t': 0, 'subDom': 50, 'alvl': 1, 'lvl': 1, 'slvl': 1, 'sexp': 0, 'exp': 0, 'exp2lvl': 15, 'sxp2lvl': 30, 'body': { 'fem': 0, 'tone': 0, 'mass': 0, 'weight': 62 } } } log.info("Setting up UI.") i = 0 l = list(equipment.accessories.keys()) while i < len(l): # Load accessory drop-down boxes with equipment.accessories. item = atlas.get(equipment.accessories, l[i]) self.acc1.addItem(item.name) self.acc1.setItemData(i, item.desc, 3) self.acc2.addItem(item.name) self.acc2.setItemData(i, item.desc, 3) i += 1 log.debug("Setup accessory combo boxes.") i = t = b = 0 l = list(equipment.armor.keys()) while i < len(l): # Load and sort armor drop-down boxes with atlas.Armor. item = atlas.get(equipment.armor, l[i]) if ('top' in str(item.type)) or ('full' in str(item.type)): self.armTop.addItem(item.name) self.armTop.setItemData(t, item.desc, 3) t += 1 elif 'bot' in str(item.type): self.armBot.addItem(item.name) self.armBot.setItemData(b, item.desc, 3) b += 1 i += 1 log.debug("Setup armor combo boxes.") l = list(equipment.weapons.keys()) i = 0 while i < len(l): # Load weapon drop-down box with atlas.Weapons. item = atlas.get(equipment.weapons, l[i]) self.weapon.addItem(item.name) self.weapon.setItemData(i, item.desc, 3) i += 1 log.debug("Setup weapon combo box.") l = list(equipment.strapons.keys()) i = 0 while i < len(l): # Load toy drop-down box with atlas.Strapons. item = atlas.get(equipment.strapons, l[i]) self.toy.addItem(item.name) self.toy.setItemData(i, item.desc, 3) i += 1 log.debug("Setup toy combo box.") # Signal/slot work section. self.actionSource.triggered.connect(lambda: web(url)) self.actionOpen.triggered.connect(self.load) self.actionSave.triggered.connect(self.save) self.acc1.highlighted['int'].connect(lambda arg: self.status(equipment.accessories, self.acc1, arg)) self.acc2.highlighted['int'].connect(lambda arg: self.status(equipment.accessories, self.acc2, arg)) self.armTop.highlighted['int'].connect(lambda arg: self.status(equipment.armor, self.armTop, arg)) self.armBot.highlighted['int'].connect(lambda arg: self.status(equipment.armor, self.armBot, arg)) self.weapon.highlighted['int'].connect(lambda arg: self.status(equipment.weapons, self.weapon, arg)) self.toy.highlighted['int'].connect(lambda arg: self.status(equipment.strapons, self.toy, arg)) self.characterName.textChanged['QString'].connect(lambda arg: self.setval('player/name', arg)) self.acc1.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/acc1', atlas.id(equipment.accessories, arg))) self.acc2.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/acc2', atlas.id(equipment.accessories, arg))) self.armTop.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/toparm', atlas.id(equipment.armor, arg))) self.armBot.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/botarm', atlas.id(equipment.armor, arg))) self.weapon.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/wep', atlas.id(equipment.weapons, arg))) self.toy.currentIndexChanged['QString'].connect(lambda arg: self.setval('player/toy', atlas.id(equipment.strapons, arg))) self.dex.valueChanged['int'].connect(lambda arg: self.setval('player/dex', arg)) self.dexG.valueChanged['double'].connect(lambda arg: self.setval('player/dexG', arg)) self.inte.valueChanged['int'].connect(lambda arg: self.setval('player/inte', arg)) self.inteG.valueChanged['double'].connect(lambda arg: self.setval('player/inteG', arg)) self.lib.valueChanged['int'].connect(lambda arg: self.setval('player/lib', arg)) self.libG.valueChanged['double'].connect(lambda arg: self.setval('player/libG', arg)) self.sta.valueChanged['int'].connect(lambda arg: self.setval('player/sta', arg)) self.staG.valueChanged['double'].connect(lambda arg: self.setval('player/staG', arg)) self.str.valueChanged['int'].connect(lambda arg: self.setval('player/str', arg)) self.strG.valueChanged['double'].connect(lambda arg: self.setval('player/strG', arg)) self.spi.valueChanged['int'].connect(lambda arg: self.setval('player/spi', arg)) self.spiG.valueChanged['double'].connect(lambda arg: self.setval('player/spiG', arg)) self.fem.valueChanged['double'].connect(lambda arg: self.setval('player/body/fem', arg)) self.mTone.valueChanged['double'].connect(lambda arg: self.setval('player/body/tone', arg)) self.s**t.valueChanged['int'].connect(lambda arg: self.setval('player/s**t', arg)) self.subDom.valueChanged['int'].connect(lambda arg: self.setval('player/subDom', arg)) self.al.valueChanged['int'].connect(lambda arg: self.setval('player/alvl', arg)) self.mass.valueChanged['double'].connect(lambda arg: self.setval('player/body/mass', arg)) self.weight.valueChanged['double'].connect(lambda arg: self.setval('player/body/weight', arg)) self.mLust.valueChanged['int'].connect(lambda arg: self.setval('player/maxLust', arg)) self.mLustG.valueChanged['int'].connect(lambda arg: self.setval('player/maxLustG', arg)) self.lust.valueChanged['double'].connect(lambda arg: self.setval('player/curLust', arg)) self.mHP.valueChanged['int'].connect(lambda arg: self.setval('player/maxHp', arg)) self.mHPG.valueChanged['int'].connect(lambda arg: self.setval('player/maxHpG', arg)) self.HP.valueChanged['int'].connect(lambda arg: self.setval('player/curHp', arg)) self.mSP.valueChanged['int'].connect(lambda arg: self.setval('player/maxSp', arg)) self.mSPG.valueChanged['int'].connect(lambda arg: self.setval('player/maxSpG', arg)) self.SP.valueChanged['int'].connect(lambda arg: self.setval('player/curSp', arg)) self.lvl.valueChanged['int'].connect(lambda arg: self.setval('player/lvl', arg)) self.slvl.valueChanged['int'].connect(lambda arg: self.setval('player/slvl', arg)) self.sxp2lvl.valueChanged['int'].connect(lambda arg: self.setval('player/sxp2lvl', arg)) self.xp2lvl.valueChanged['int'].connect(lambda arg: self.setval('player/exp2lvl', arg)) self.SXP.valueChanged['int'].connect(lambda arg: self.setval('player/sexp', arg)) self.XP.valueChanged['int'].connect(lambda arg: self.setval('player/exp', arg)) self.lvl.valueChanged['int'].connect(lambda arg: self.getXP2lvl(arg)) self.slvl.valueChanged['int'].connect(lambda arg: self.getSXP2lvl(arg)) # End signal/slot work. self.reset()