本文整理汇总了Python中quodlibet.qltk.browser.LibraryBrowser类的典型用法代码示例。如果您正苦于以下问题:Python LibraryBrowser类的具体用法?Python LibraryBrowser怎么用?Python LibraryBrowser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LibraryBrowser类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ctr
def test_ctr(self):
from quodlibet.library import SongLibrary
from quodlibet.browsers.empty import EmptyBar
win = LibraryBrowser(EmptyBar, SongLibrary(), NullPlayer())
win.browser.emit("songs-selected", [], False)
win.songlist.get_selection().emit("changed")
win.destroy()
示例2: quit_gtk
def quit_gtk(window):
if before_quit is not None:
before_quit()
# disable plugins
import quodlibet.plugins
quodlibet.plugins.quit()
# for debug: this will list active copools
from quodlibet.util import copool
copool.pause_all()
# See which browser windows are open and save their names
# so we can restore them on start
from quodlibet.qltk.browser import LibraryBrowser
LibraryBrowser.save()
# destroy all open windows so they hide immediately on close:
# destroying all top level windows doesn't work (weird errors),
# so we hide them all and only destroy our tracked instances
# (browser windows, tag editors, pref window etc.)
from quodlibet.qltk import Window
for toplevel in Gtk.Window.list_toplevels():
toplevel.hide()
for window in Window.windows:
window.destroy()
Gtk.main_quit()
print_d("Quit GTK: done.")
示例3: _open_browser
def _open_browser(app, value):
value = arg2text(value)
try:
Kind = browsers.get(value)
except ValueError:
raise CommandError("Unknown browser %r" % value)
LibraryBrowser.open(Kind, app.library, app.player)
示例4: test_open
def test_open(self):
from quodlibet.browsers.empty import EmptyBar
from quodlibet.library import SongLibrary
widget = LibraryBrowser.open(EmptyBar, SongLibrary(), NullPlayer())
self.assertTrue(widget)
self.assertTrue(widget.get_visible())
widget.destroy()
示例5: __copy_to_device
def __copy_to_device(device, songs, library):
if len(MediaDevices.instances()) > 0:
browser = MediaDevices.instances()[0]
else:
win = LibraryBrowser.open(MediaDevices, library, app.player)
browser = win.browser
browser.select(device)
browser.dropped(songs)
示例6: plugin_songs
def plugin_songs(self, songs):
tag = "~dirname"
values = []
for song in songs:
values.extend(song.list(tag))
browser = LibraryBrowser.open(
browsers.get("SearchBar"), app.library, app.player)
browser.browser.filter(tag, set(values))
示例7: browser_activate
def browser_activate(action, Kind):
LibraryBrowser.open(Kind, library, player)
示例8: _open_browser
def _open_browser(app, value):
Kind = browsers.get(value)
if Kind is not browsers.empty.EmptyBar:
LibraryBrowser.open(Kind, app.library, app.player)
else:
raise CommandError("Unknown browser %r" % value)