def goForums(self, event): wx.LaunchDefaultBrowser('https://forums.eveonline.com/default.aspx?g=posts&t=247609')
def OnHelp(self, event): wx.LaunchDefaultBrowser( 'http://kiwi.cs.dal.ca/GenGIS/index.php/Description_of_GenGIS_plugins#Bar_Graph' )
def OnUserGuide(self, event): wx.LaunchDefaultBrowser("http://robotframework.org/robotframework/" "#user-guide")
def OnShowLog(self, evt): """Called when the user clicks on the "Log" button""" if self._log_file: wx.LaunchDefaultBrowser("file:%s" % os.path.abspath(self._log_file))
def OnLinkClicked(self, link): wx.LaunchDefaultBrowser(link.GetHref())
def OnHelpButton(self, evt=None): wx.LaunchDefaultBrowser('http://wiki.digsby.com')
def OnWiki(self, event): wx.LaunchDefaultBrowser("https://github.com/robotframework/RIDE/wiki")
def storyFormatHelp(self, event=None): """Opens the online manual to the section on story formats.""" wx.LaunchDefaultBrowser('http://twinery.org/wiki/story_format')
def openForum(self, event=None): """Opens the forum.""" wx.LaunchDefaultBrowser('http://twinery.org/forum/')
def onPavloviaRun(self, evt=None): if self.frame.project: self.frame.project.pavloviaStatus = 'ACTIVATED' url = "https://run.pavlovia.org/{}/html".format( self.frame.project.id) wx.LaunchDefaultBrowser(url)
def OnDonate(self, evt): wx.LaunchDefaultBrowser(_("https://www.skeed.it/songpress#donate")) evt.Skip()
def OnWebSite(self, event): wx.LaunchDefaultBrowser("https://github.com/lucsch/bookmaction")
def OnUserGuide(self, event): wx.LaunchDefaultBrowser( 'http://code.google.com/p/robotframework/wiki/UserGuide')
def OnReportaProblem(self, event): wx.LaunchDefaultBrowser( 'http://code.google.com/p/robotframework-ride/issues/list')
def openHomepage(self): u"""打开项目主页""" url = "http://oldj.github.io/SwitchHosts/" wx.LaunchDefaultBrowser(url)
def openDocs(self, event=None): """Opens the online manual.""" wx.LaunchDefaultBrowser('http://twinery.org/wiki/')
def openFeedbackPage(self): u"""打开反馈主页""" url = "https://github.com/oldj/SwitchHosts/issues?direction=desc&sort=created&state=open" wx.LaunchDefaultBrowser(url)
def openGitHub(self, event=None): """Opens the GitHub page.""" wx.LaunchDefaultBrowser('https://github.com/tweecode/twine')
def OnReportaProblem(self, event): wx.LaunchDefaultBrowser("https://github.com/robotframework/RIDE/issues" "?utf8=%E2%9C%93&q=is%3Aissue+%22search" "%20your%20problem%22")
def __init__(self, fullscr=True, interactive=True, log=True): self.firstrun = False self.prefs = prefs self.appName = 'PsychoPy2' self.name = self.appName + _translate(' Benchmark Wizard') dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText(_translate('Benchmarking takes ~20-30 seconds to gather')) dlg.addText(_translate('configuration and performance data. Begin?')) dlg.addText('') if interactive: dlg.show() if not dlg.OK: return self._prepare() win = visual.Window(fullscr=fullscr, allowGUI=False, monitor='testMonitor', autoLog=False) # do system info etc first to get fps, add to list later because # it's nicer for benchmark results to appears at top of the report: diagnostics = self.runDiagnostics(win, verbose=True) info = {} for k, v, m, w in diagnostics: # list of tuples --> dict, ignore msg m, warning w info[k] = v fps = 1000. / float(info['visual sync (refresh)'].split()[0]) itemsList = [('Benchmark', '', '', False)] itemsList.append(('benchmark version', '0.1', _translate('dots & configuration'), False)) itemsList.append(('full-screen', str(fullscr), _translate('visual window for drawing'), False)) if int(info['no dropped frames'].split('/')[0]) != 0: # eg, "0 / 180" start = 50 # if 100 dots had problems earlier, here start lower else: start = 200 for shape in ['circle', 'square']: # order matters: circle crashes first dotsList = self.runLotsOfDots(win, fieldShape=shape, starting=start, baseline=fps) itemsList.extend(dotsList) start = int( dotsList[-1][1]) # start square where circle breaks down itemsList.extend(diagnostics) win.close() itemsDict = {} for itm in itemsList: if 'proxy setting' in itm[0] or not itm[1]: continue itemsDict[itm[0]] = itm[1].replace('<strong>', '').replace( '</strong>', '').replace(' ', '').replace(' ', '') # present dialog, upload only if opt-in: dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText( _translate('Benchmark complete! (See the Coder output window.)')) # disable upload for now at least: ''' dlg.addText(_translate('Are you willing to share your data at psychopy.org?')) dlg.addText(_translate('Only configuration and performance data are shared;')) dlg.addText(_translate('No personally identifying information is sent.')) dlg.addText(_translate('(Sharing requires an internet connection.)')) if interactive: dlg.show() if dlg.OK: status = self.uploadReport(itemsDict) dlg = gui.Dlg(title=self.name + ' result') dlg.addText('') if status and status.startswith('success good_upload'): dlg.addText(_translate('Configuration data were successfully uploaded to')) dlg.addText('http://upload.psychopy.org/benchmark/report.html') dlg.addText(_translate('Thanks for participating!')) else: if not eval(info['internet access']): dlg.addText('Upload error: maybe no internet access?') else: dlg.addText('Upload error status: %s' % status[:20]) dlg.show() ''' self.htmlReport(itemsList) self.reportPath = os.path.join(self.prefs.paths['userPrefsDir'], 'benchmarkReport.html') self.save() dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText( _translate( 'Click OK to view full configuration and benchmark data.')) dlg.addText(_translate('Click Cancel to stay in PsychoPy.')) dlg.addText('') if interactive: dlg.show() if dlg.OK: url = 'file://' + self.reportPath wx.LaunchDefaultBrowser(url)
def OnShowReport(self, evt): """Called when the user clicks on the "Report" button""" if self._report_file: wx.LaunchDefaultBrowser("file:%s" % os.path.abspath(self._report_file))
def OnDownload(self, event): wx.LaunchDefaultBrowser( 'https://github.com/pyfa-org/Pyfa/releases/tag/' + self.UpdateSettings.get('version'))
def open_external_links(self, event): link = event.GetLinkInfo().GetHref() if ':' in link: wx.LaunchDefaultBrowser(link) else: self.help_htmlwindow.LoadPage(link)
def __init__(self, firstrun=False, interactive=True, log=True): """Check drivers, show GUIs, run diagnostics, show report. """ super(ConfigWizard, self).__init__() self.firstrun = firstrun self.prefs = prefs self.appName = 'PsychoPy3' self.name = self.appName + _translate(' Configuration Wizard') self.reportPath = os.path.join(self.prefs.paths['userPrefsDir'], 'firstrunReport.html') # self.iconfile = os.path.join(self.prefs.paths['resources'], # 'psychopy.png') # dlg.SetIcon(wx.Icon(self.iconfile, wx.BITMAP_TYPE_PNG)) # no error # but no effect dlg = gui.Dlg(title=self.name) dlg.addText('') if firstrun: dlg.addText(_translate("Welcome to PsychoPy3!"), color='blue') dlg.addText('') dlg.addText( _translate("It looks like you are running PsychoPy " "for the first time.")) dlg.addText( _translate("This wizard will help you get started " "quickly and smoothly.")) else: dlg.addText(_translate("Welcome to the configuration wizard.")) # test for fatal configuration errors: fatalItemsList = [] cardInfo = gl_info.get_renderer().replace('OpenGL Engine', '').strip() if not driversOkay(): dlg.addText('') dlg.addText(_translate("The first configuration check is your " "video card's drivers. The current"), color='red') dlg.addText(_translate("drivers cannot support PsychoPy, so " "you'll need to update the drivers."), color='red') msg = _translate( """<p>Critical issue:\n</p><p>Your video card (%(card)s) has drivers that cannot support the high-performance features that PsychoPy depends on. Fortunately, it's typically free and straightforward to get new drivers directly from the manufacturer.</p> <p><strong>To update the drivers:</strong> <li> You'll need administrator privileges. <li> On Windows, don't use the windows option to check for updates - it can report that there are no updates available. <li> If your card is made by NVIDIA, go to <a href="http://www.nvidia.com/Drivers">the NVIDIA website</a> and use the 'auto detect' option. Try here for <a href="http://support.amd.com/">ATI / Radeon drivers</a>. Or try <a href="http://www.google.com/search?q=download+drivers+%(card2)s"> this google search</a> [google.com]. <li> Download and install the driver. <li> Reboot the computer. <li> Restart PsychoPy.</p> <p>If you updated the drivers and still get this message, you'll need a different video card to use PsychoPy. Click <a href="http://www.psychopy.org/installation.html#recommended-hardware">here for more information</a> [psychopy.org].</p> """) fatalItemsList.append(msg % { 'card': cardInfo, 'card2': cardInfo.replace(' ', '+') }) if not cardOkay(): msg = _translate("""<p>Critical issue:\n</p>""") msg += cardInfo fatalItemsList.append(msg) pass # other fatal conditions? append a 'Critical issue' msg to itemsList if not fatalItemsList: dlg.addText( _translate("We'll go through a series of configura" "tion checks in about 10 seconds. ")) dlg.addText('') if firstrun: # explain things more dlg.addText( _translate('Note: The display will switch to ' 'full-screen mode and will ')) dlg.addText( _translate("then switch back. You don't need " "to do anything.")) dlg.addText( _translate('Optional: For best results, please quit' ' all email programs, web-browsers, ')) dlg.addText( _translate('Dropbox, backup or sync services, and others.')) dlg.addText('') dlg.addText(_translate('Click OK to start, or Cancel to skip.')) if not self.firstrun: dlg.addField(label=_translate('Full details'), initial=self.prefs.app['debugMode']) else: dlg.addText('') dlg.addText( _translate( 'Click OK for more information, or Cancel to skip.')) # show the first dialog: dlg.addText('') if interactive: dlg.show() if fatalItemsList: self.htmlReport(fatal=fatalItemsList) self.save() # user ends up in browser: url = 'file://' + self.reportPath if interactive: wx.LaunchDefaultBrowser(url) return if interactive and not dlg.OK: return # no configuration tests run # run the diagnostics: verbose = interactive and not self.firstrun and dlg.data[0] win = visual.Window(fullscr=interactive, allowGUI=False, monitor='testMonitor', autoLog=log) itemsList = self.runDiagnostics(win, verbose) # sets self.warnings win.close() self.htmlReport(itemsList) self.save() # display summary & options: dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText(_translate('Configuration testing complete!')) summary = self.summary(items=itemsList) numWarn = len(self.warnings) if numWarn == 0: msg = _translate('All values seem reasonable (no warnings).') elif numWarn == 1: txt = _translate('1 suboptimal value was detected (%s)') msg = txt % self.warnings[0] else: txt = _translate( '%(num)i suboptimal values were detected (%(warn)s, ...)') msg = txt % {'num': len(self.warnings), 'warn': self.warnings[0]} dlg.addText(msg) for item in summary: dlg.addText(item[0], item[1]) # (key, color) dlg.addText('') dlg.addText( _translate( 'Click OK for full details (will open in a web-browser),')) dlg.addText(_translate('or Cancel to stay in PsychoPy.')) dlg.addText('') if interactive: dlg.show() if dlg.OK: url = 'file://' + self.reportPath wx.LaunchDefaultBrowser(url) return
def onMoveDataButton(self, event): # webbrowser.open() is known to be unreliable on Linux so using wx instead wx.LaunchDefaultBrowser(MIGRATION_URL, wx.BROWSER_NEW_WINDOW) self.EndModal(wx.CANCEL)
def __init__(self, fullscr=True, interactive=True, log=True): super(BenchmarkWizard, self).__init__() self.firstrun = False self.prefs = prefs self.appName = 'PsychoPy3' self.name = self.appName + _translate(' Benchmark Wizard') dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText(_translate('Benchmarking takes ~20-30 seconds to gather')) dlg.addText(_translate('configuration and performance data. Begin?')) dlg.addText('') if interactive: dlg.show() if not dlg.OK: return self._prepare() win = visual.Window(fullscr=fullscr, allowGUI=False, monitor='testMonitor', autoLog=False) # do system info etc first to get fps, add to list later because # it's nicer for benchmark results to appears at top of the report: diagnostics = self.runDiagnostics(win, verbose=True) info = {} for k, v, m, w in diagnostics: # list of tuples --> dict, ignore msg m, warning w info[k] = v fps = 1000.0 / float(info['visual sync (refresh)'].split()[0]) itemsList = [('Benchmark', '', '', False)] itemsList.append(('benchmark version', '0.1', _translate('dots & configuration'), False)) itemsList.append(('full-screen', str(fullscr), _translate('visual window for drawing'), False)) if int(info['no dropped frames'].split('/')[0]) != 0: # eg, "0 / 180" start = 50 # if 100 dots had problems earlier, here start lower else: start = 200 for shape in ('circle', 'square'): # order matters: circle crashes first dotsList = self.runLotsOfDots(win, fieldShape=shape, starting=start, baseline=fps) itemsList.extend(dotsList) # start square where circle breaks down start = int(dotsList[-1][1]) itemsList.extend(diagnostics) win.close() itemsDict = {} for itm in itemsList: if 'proxy setting' in itm[0] or not itm[1]: continue itemsDict[itm[0]] = itm[1].replace('<strong>', '').replace( '</strong>', '').replace(' ', '').replace(' ', '') # present dialog, upload only if opt-in: dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText( _translate('Benchmark complete! (See the Coder output window.)')) self.htmlReport(itemsList) self.reportPath = os.path.join(self.prefs.paths['userPrefsDir'], 'benchmarkReport.html') self.save() dlg = gui.Dlg(title=self.name) dlg.addText('') dlg.addText( _translate( 'Click OK to view full configuration and benchmark data.')) dlg.addText(_translate('Click Cancel to stay in PsychoPy.')) dlg.addText('') if interactive: dlg.show() if dlg.OK: url = 'file://' + self.reportPath wx.LaunchDefaultBrowser(url)
def OnReportaProblem(self, event): wx.LaunchDefaultBrowser( "https://github.com/robotframework/RIDE/issues")
def OnDonate(self, event): wx.LaunchDefaultBrowser("https://me.alipay.com/oldj")
def onHelp(self, event=None): """similar to self.app.followLink() to self.helpUrl, but only use url """ wx.LaunchDefaultBrowser(self.helpUrl)
def goWiki(self, event): wx.LaunchDefaultBrowser('https://github.com/DarkFenX/Pyfa/wiki')