• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.website函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中quodlibet.util.website函数的典型用法代码示例。如果您正苦于以下问题:Python website函数的具体用法?Python website怎么用?Python website使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了website函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: plugin_songs

 def plugin_songs(self, songs):
     # Check this is a launch, not a configure
     if self.chosen_site:
         url_pat = self.get_url_pattern(self.chosen_site)
         pat = Pattern(url_pat)
         urls = set()
         for song in songs:
             # Generate a sanitised AudioFile; allow through most tags
             subs = AudioFile()
             for k in (USER_TAGS + MACHINE_TAGS):
                 vals = song.comma(k)
                 if vals:
                     try:
                         encoded = unicode(vals).encode('utf-8')
                         subs[k] = (encoded if k == 'website'
                                    else quote_plus(encoded))
                     # Dodgy unicode problems
                     except KeyError:
                         print_d("Problem with %s tag values: %r"
                                 % (k, vals))
             url = str(pat.format(subs))
             if not url:
                 print_w("Couldn't build URL using \"%s\"."
                         "Check your pattern?" % url_pat)
                 return
             # Grr, set.add() should return boolean...
             if url not in urls:
                 urls.add(url)
                 website(url)
开发者ID:urielz,项目名称:quodlibet,代码行数:29,代码来源:website_search.py


示例2: show_shortcuts

def show_shortcuts(parent):
    """Either opens a window showing keyboard shortcuts or a website in the
    default browser, depending on the Gtk+ version
    """

    if has_shortcut_window():
        window = build_shortcut_window(SHORTCUTS)
        window.set_transient_for(parent)
        window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
        window.set_modal(True)
        window.show()
    else:
        util.website(const.SHORTCUTS_HELP)
开发者ID:bp0,项目名称:quodlibet,代码行数:13,代码来源:shortcuts.py


示例3: PluginPreferences

    def PluginPreferences(self, win):
        box = Gtk.VBox(spacing=12)

        # api key section
        def key_changed(entry, *args):
            config.set("plugins", "fingerprint_acoustid_api_key",
                entry.get_text())

        button = Button(_("Request API key"), Icons.NETWORK_WORKGROUP)
        button.connect("clicked",
            lambda s: util.website("https://acoustid.org/api-key"))
        key_box = Gtk.HBox(spacing=6)
        entry = UndoEntry()
        entry.set_text(get_api_key())
        entry.connect("changed", key_changed)
        label = Gtk.Label(label=_("API _key:"))
        label.set_use_underline(True)
        label.set_mnemonic_widget(entry)
        key_box.pack_start(label, False, True, 0)
        key_box.pack_start(entry, True, True, 0)
        key_box.pack_start(button, False, True, 0)

        box.pack_start(Frame(_("AcoustID Web Service"),
                       child=key_box), True, True, 0)

        return box
开发者ID:bossjones,项目名称:quodlibet,代码行数:26,代码来源:__init__.py


示例4: plugin_songs

 def plugin_songs(self, songs, launch=True) -> bool:
     # Check this is a launch, not a configure
     if self.chosen_site:
         url_pat = self.get_url_pattern(self.chosen_site)
         pat = Pattern(url_pat)
         # Remove Nones, and de-duplicate collection
         urls = set(filter(None, (website_for(pat, s) for s in songs)))
         if not urls:
             print_w("Couldn't build URLs using \"%s\"."
                     "Check your pattern?" % url_pat)
             return False
         print_d("Got %d websites from %d songs" % (len(urls), len(songs)))
         if launch:
             for url in urls:
                 website(url)
     return True
开发者ID:LudoBike,项目名称:quodlibet,代码行数:16,代码来源:website_search.py


示例5: run_error_dialogs

def run_error_dialogs(exc_info, sentry_error):
    error_text = u"%s: %s" % (
        exc_info[0].__name__,
        (text_type(exc_info[1]).strip() or u"\n").splitlines()[0])
    error_text += u"\n------\n"
    error_text += u"\n".join(format_exception(*exc_info))

    window = find_active_window()
    if window is None:
        return

    # XXX: This does blocking IO and uses nested event loops... but it's simple
    dialog = ErrorDialog(
        window, error_text, show_bug_report=(sentry_error is None))
    while 1:
        response = dialog.run()
        if response == ErrorDialog.RESPONSE_QUIT:
            dialog.destroy()
            app.quit()
        elif response == ErrorDialog.RESPONSE_SUBMIT:
            dialog.hide()
            submit_dialog = SubmitErrorDialog(
                window, sentry_error.get_report())
            submit_response = submit_dialog.run()

            if submit_response == SubmitErrorDialog.RESPONSE_SUBMIT:
                sentry_error.set_comment(submit_dialog.get_comment())
                timeout_seconds = 5
                try:
                    sentry_error.send(timeout_seconds)
                except SentryError:
                    print_exc()
                submit_dialog.destroy()
                dialog.destroy()
            else:
                submit_dialog.destroy()
                dialog.show()
                continue
        elif response == ErrorDialog.RESPONSE_BUGREPORT:
            url = get_github_issue_url(exc_info)
            website(url)
            dialog.destroy()
        else:
            dialog.destroy()
        break
开发者ID:elfalem,项目名称:quodlibet,代码行数:45,代码来源:main.py


示例6: show_shortcuts

def show_shortcuts(parent):
    """Either opens a window showing keyboard shortcuts or a website in the
    default browser, depending on the Gtk+ version
    """

    if has_shortcut_window():
        window = build_shortcut_window(SHORTCUTS)
        window.set_transient_for(parent)
        window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
        window.set_modal(True)
        window.show()
        # XXX: The windows does some weird size changes on start which confuses
        # window placement. This fixes the jumping around and wrong position
        # with some WMs and under Windows.
        window.hide()
        window.show()
    else:
        util.website(const.SHORTCUTS_HELP)
开发者ID:ZDBioHazard,项目名称:quodlibet,代码行数:18,代码来源:shortcuts.py


示例7: _create_footer

 def _create_footer(self):
     hbox = Gtk.HBox()
     button = Gtk.Button(always_show_image=True,
                         relief=Gtk.ReliefStyle.NONE)
     button.connect('clicked', lambda _: website(SITE_URL))
     button.set_tooltip_text(_("Go to %s" % SITE_URL))
     button.add(self._logo_image)
     hbox.pack_start(button, True, True, 6)
     hbox.show_all()
     return hbox
开发者ID:zsau,项目名称:quodlibet,代码行数:10,代码来源:main.py


示例8: PluginPreferences

    def PluginPreferences(cls, window):
        table = Gtk.Table(n_rows=len(engines), n_columns=2)
        table.props.expand = False
        table.set_col_spacings(6)
        table.set_row_spacings(6)
        frame = qltk.Frame(_("Sources"), child=table)

        for i, eng in enumerate(sorted(engines, key=lambda x: x["url"])):
            check = cls.ConfigCheckButton(eng["config_id"].title(), CONFIG_ENG_PREFIX + eng["config_id"], True)
            table.attach(check, 0, 1, i, i + 1)

            button = Gtk.Button(label=eng["url"])
            button.connect("clicked", lambda s: util.website(s.get_label()))
            table.attach(button, 1, 2, i, i + 1, xoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.SHRINK)
        return frame
开发者ID:faubiguy,项目名称:quodlibet,代码行数:15,代码来源:albumart.py


示例9: __add

    def __add(self, add, song):
        artist = song.comma('artist').encode('utf-8')

        util.website("http://lyricwiki.org/%s" % (quote(artist)))
开发者ID:piotrdrag,项目名称:quodlibet,代码行数:4,代码来源:lyrics.py


示例10: authenticate_user

 def authenticate_user(self):
     # create client object with app credentials
     if self.access_token:
         print_d("Ignoring saved Soundcloud token...")
     # redirect user to authorize URL
     website(self._authorize_url)
开发者ID:bernd-wechner,项目名称:quodlibet,代码行数:6,代码来源:api.py


示例11: search_help_handler

 def search_help_handler(*args):
     util.website(const.SEARCH_HELP)
开发者ID:kriskielce88,项目名称:xn--ls8h,代码行数:2,代码来源:quodlibetwindow.py


示例12: website_handler

 def website_handler(*args):
     util.website(const.ONLINE_HELP)
开发者ID:kriskielce88,项目名称:xn--ls8h,代码行数:2,代码来源:quodlibetwindow.py


示例13: __view_online

    def __view_online(self, add, song):
        artist = song.comma('artist').encode('utf-8')
        title = song.comma('title').encode('utf-8')

        util.website("http://lyrics.wikia.com/%s:%s"
                     % (quote(artist), quote(title)))
开发者ID:LudoBike,项目名称:quodlibet,代码行数:6,代码来源:lyrics.py


示例14: plugin_songs

 def plugin_songs(self, songs):
     l = dict.fromkeys([song(self.k) for song in songs]).keys()
     for a in l:
         a = quote(str(a).title().replace(' ', '_'))
         website(WIKI_URL % get_lang() + a)
开发者ID:LudoBike,项目名称:quodlibet,代码行数:5,代码来源:wikipedia.py


示例15: __add

    def __add(self, add, song):
        artist = song.comma("artist").encode("utf-8")

        util.website("http://lyricwiki.org/%s" % (urllib.quote(artist)))
开发者ID:urielz,项目名称:quodlibet,代码行数:4,代码来源:lyrics.py



注:本文中的quodlibet.util.website函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python collection.Album类代码示例发布时间:2022-05-26
下一篇:
Python util.title函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap