python类open_new_tab()的实例源码

app.py 文件源码 项目:FuME 作者: fupadev 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def openGameReport(self):
        selected = self.get_selectedMatches()
        if selected:
            for match in selected:
                webbrowser.open_new_tab('https://www.fupa.net/spielberichte/xxx-xxx-xxx-%d.html' % match['match_id'])
oauth_utils.py 文件源码 项目:diycrate 作者: jheld 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def oauth_dance(redis_client, conf, bottle_app, file_event_handler, bottle_thread=None):
    diycrate_secret_key = redis_client.get('diycrate_secret_key') or str(uuid.uuid4())
    if not redis_client.exists('diycrate_secret_key'):
        redis_client.set('diycrate_secret_key', diycrate_secret_key)
    bottle_app.oauth = file_event_handler.oauth = setup_remote_oauth(redis_client)
    import requests
    auth_url, bottle_app.csrf_token = requests.get(conf['box']['authorization_url'], data={'redirect_url': 'https://localhost:8080/', }, verify=False).json()
    # auth_url, bottle_app.csrf_token = bottle_app.oauth.get_authorization_url(auth_url)
    if bottle_thread and not bottle_thread.is_alive():
        bottle_thread.start()
    webbrowser.open_new_tab(auth_url)  # make it easy for the end-user to start auth
server.py 文件源码 项目:lifter 作者: EliotBerriot 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def main():

    build_project_path = '_build'
    if not os.path.exists(build_project_path):
        os.system('make html')

    server = Server()
    server.watch('./*.rst', shell('make html'))
    server.watch('./*/*.rst', shell('make html'))
    webbrowser.open_new_tab('http://127.0.0.1:5500')
    server.serve(root='_build/html')
cli.py 文件源码 项目:ggmt 作者: Granitosaurus 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def watch(game, show, template, in_window, use_streamlink, quality, just_print):
    matches = list(download_matches(game))
    if not show:
        matches = [m for m in matches if m.get('stream')]
    if not matches:
        click.echo('No streams found :(')
        return

    template = template if template else DEFAULT_TEMPLATE_ALL if game == 'all' else DEFAULT_TEMPLATE
    template = Template(template)
    items = ['{}: {}'.format(i, template.render(m)) for i, m in enumerate(matches)]
    for item in items:
        click.echo(item)
    click.echo('-' * len(sorted(items)[0]))
    while True:
        click.echo('select stream to show: ', nl=False)
        choice = input('')
        if not choice.isdigit():
            click.echo('  "{}" is not a number'.format(choice))
            continue
        choice = int(choice)
        if choice not in range(0, len(matches)):
            click.echo('  {} is out of range'.format(choice))
            continue
        break

    selected = matches[choice].get('stream')
    if not selected:
        click.secho('cannot stream for match #{}: no stream'.format(choice), err=True, fg='red')
        return

    if just_print:
        click.echo(selected)
        return
    click.echo('Opening {}...'.format(selected))
    if use_streamlink:
        subprocess.Popen(['nohup streamlink "{}" {} &'.format(selected, quality)], shell=True, start_new_session=True)
    elif not in_window:
        webbrowser.open_new_tab(selected)
    else:
        webbrowser.open(selected, new=1)
app.py 文件源码 项目:boartty 作者: openstack 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def openURL(self, url):
        self.log.debug("Open URL %s" % url)
        webbrowser.open_new_tab(url)
        self.loop.screen.clear()
other.py 文件源码 项目:Requester 作者: kylebebak 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def run(self, online=False):
        if online:
            webbrowser.open_new_tab('http://requester.org')
            return
        show_read_only_doc_view(self.window.new_file(),
                                sublime.load_resource('Packages/Requester/docs/_content/body.md'),
                                'Requester Documentation')
other.py 文件源码 项目:Requester 作者: kylebebak 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def run(self):
        webbrowser.open_new_tab('http://docs.python-requests.org/en/master/user/quickstart/')
util.py 文件源码 项目:diluvian 作者: aschampion 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def open_in_browser(self):
        webbrowser.open_new_tab(str(self))
githubNotif.py 文件源码 项目:github-notifications 作者: unknownuser88 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def run(self):
        webbrowser.open_new_tab("https://github.com/notifications")
tkdialogs.py 文件源码 项目:docximport-sigil-plugin 作者: dougmassay 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def get_update(self):
        url = DOWNLOAD_PAGE
        if self.update:
            latest = '/tag/v{}'.format(self.newversion)
            url = url + latest
        webbrowser.open_new_tab(url)
qtdialogs.py 文件源码 项目:docximport-sigil-plugin 作者: dougmassay 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def get_update(self):
        url = DOWNLOAD_PAGE
        if self.update:
            latest = '/tag/v{}'.format(self.newversion)
            url = url + latest
        webbrowser.open_new_tab(url)
donate.py 文件源码 项目:blender-terrain 作者: vvoovv 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def execute(self, context):
        webbrowser.open_new_tab(url)
        return {'FINISHED'}
util.py 文件源码 项目:SalesforceXyTools 作者: exiahuang 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def open_in_default_browser(url):
    browser_map = setting.get_default_browser()
    browser_name = browser_map['name']
    browser_path = browser_map['path']

    if not browser_path or not os.path.exists(browser_path) or browser_name == "default":
        webbrowser.open_new_tab(url)

    elif browser_map['name'] == "chrome-private":
        # chromex = "\"%s\" --incognito %s" % (browser_path, url)
        # os.system(chromex)
        browser = webbrowser.get('"' + browser_path +'" --incognito %s')
        browser.open(url)

        # os.system("\"%s\" -ArgumentList @('-incognito', %s)" % (browser_path, url))

    else:
        try:
            webbrowser.register('chromex', None, webbrowser.BackgroundBrowser(browser_path))
            webbrowser.get('chromex').open_new_tab(url)
        except Exception as e:
            webbrowser.open_new_tab(url)

##########################################################################################
#END
##########################################################################################
ToolTipHelper.py 文件源码 项目:ToolTip-Helper 作者: AvitanI 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def on_navigate(self, href):
        """ open the link in a new tab on web browser """
        try:
            webbrowser.open_new_tab(href)
        except Exception as e:
            logging.error('cannot open link on web browser.')
hyper_click_annotator.py 文件源码 项目:SublimeHyperClick 作者: aziz 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def on_navigate(self, url):
            if url.startswith('http://') or url.startswith('https://'):
                webbrowser.open_new_tab(url)
            else:
                self.window.open_file(url)
prepare_ui.py 文件源码 项目:kapsel 作者: conda 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def _default_show_url(url):
    import webbrowser
    webbrowser.open_new_tab(url)
main_button_menu.py 文件源码 项目:bokken 作者: thestr4ng3r 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def show_wiki(self, widget):
        webbrowser.open_new_tab('http://inguma.eu/projects/bokken/wiki')
manjaro_hello.py 文件源码 项目:manjaro-hello 作者: manjaro 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def on_link_clicked(self, link, _=None):
        """Event for clicked link."""
        webbrowser.open_new_tab(self.preferences["urls"][link.get_name()])
account.py 文件源码 项目:cli 作者: riseml 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def run_upgrade(args):
    api_client = ApiClient()
    client = AdminApi(api_client)
    account = call_api(lambda: client.get_account_info())
    if account.key is None:
        print('You have not registered with an account. '
              'Please run ' + bold('riseml account register'))
    else:
        register_url = get_riseml_url() + 'upgrade/%s' % account.key
        if browser_available():
            webbrowser.open_new_tab(register_url)
        else:
            print('Please visit this URL and follow instructions'
                ' to upgrade your account: %s' % register_url)
USTC_Today3.0.py 文件源码 项目:USTC-Today 作者: HengRuiZ 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def openurl(url):
  webbrowser.open_new_tab(url)


问题


面经


文章

微信
公众号

扫码关注公众号