本文整理汇总了Python中rb.find_plugin_file函数的典型用法代码示例。如果您正苦于以下问题:Python find_plugin_file函数的具体用法?Python find_plugin_file怎么用?Python find_plugin_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了find_plugin_file函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, source, window):
super(ViewManager, self).__init__()
self.source = source
self.window = window
# initialize views
self._views = {}
ui = Gtk.Builder()
ui.add_from_file(rb.find_plugin_file(source.plugin,
'ui/coverart_iconview.ui'))
self._views[CoverIconView.name] = ui.get_object('covers_view')
self._views[CoverFlowView.name] = CoverFlowView()
self._views[ListView.name] = ListView()
ui.add_from_file(rb.find_plugin_file(source.plugin,
'ui/coverart_artistview.ui'))
self._views[ArtistView.name] = ui.get_object('artist_view')
self._lastview = None
self.controller = ViewController(source.shell, self)
# connect signal and properties
self._connect_signals()
self._connect_properties()
self._lastview = self.view_name
if self.current_view.use_plugin_window:
window.add(self.current_view.view)
window.show_all()
开发者ID:Hunsu,项目名称:coverart-browser,代码行数:28,代码来源:coverart_browser_source.py
示例2: do_create_configure_widget
def do_create_configure_widget(self):
builder = Gtk.Builder()
print rb.find_plugin_file(self, "tab-prefs.ui")
builder.add_from_file(rb.find_plugin_file(self, "tab-prefs.ui"))
self.dialog = builder.get_object("preferences_dialog")
self.path_display = builder.get_object("path_display")
self.dialog.connect("response", self.dialog_response)
preferences = self.get_prefs()
site_box = builder.get_object("sites")
self.site_checks = {}
for s in tab_sites:
site_id = s['id']
checkbutton = Gtk.CheckButton(label = s['name'])
checkbutton.set_active(s['id'] in preferences['sites'])
self.site_checks[site_id] = checkbutton
site_box.pack_start(checkbutton, expand=False, fill=True, padding=0)
self.filechooser = builder.get_object('filechooser')
self.filechooser.set_current_folder(preferences['folder'])
self.preventAutoWebLookup_checkbutton = builder.get_object('preventAutoWebLookup_checkbutton')
self.preventAutoWebLookup_checkbutton.set_active(preferences['preventAutoWebLookup'])
self.default_folder_button = builder.get_object('default_folder_button')
self.default_folder_button.connect('clicked', self.set_folderchooser_to_default)
site_box.show_all()
开发者ID:DanieloDelgado,项目名称:tab-rhythmbox-plugin,代码行数:32,代码来源:TabConfigureDialog.py
示例3: do_create_configure_widget
def do_create_configure_widget(self):
def account_details_changed(entry, event):
username = builder.get_object('usernameEntry').get_text()
password = builder.get_object('passwordEntry').get_text()
gStatsUtil.save_account_info(username, password, self.plugin_info.get_data_dir())
return False
self.configure_callback_dic = {
"rb_google_sync_info_changed_cb" : account_details_changed,
}
builder = Gtk.Builder()
builder.add_from_file(rb.find_plugin_file(self, 'preferences.ui'))
dialog = builder.get_object('vbox1')
builder.connect_signals(self.configure_callback_dic)
account_file = rb.find_plugin_file(self, 'account.dat')
if account_file != None:
f = open(account_file)
builder.get_object('usernameEntry').set_text(f.readline().rstrip())
builder.get_object('passwordEntry').set_text(f.readline())
f.close()
return dialog
开发者ID:silpol,项目名称:rb-google-stats,代码行数:27,代码来源:__init__.py
示例4: load_templates
def load_templates(self, plugin):
'''
Loads the templates and stylesheets to be used by the pane.
'''
# input_encoding='utf-8',
path = rb.find_plugin_file(plugin,
'tmpl/albumartsearch-tmpl.html')
self.template = Template(filename=path,
default_filters=['decode.utf8'],
module_directory='/tmp/',
encoding_errors='replace')
path = rb.find_plugin_file(plugin,
'tmpl/albumartsearchempty-tmpl.html')
self.empty_template = Template(filename=path,
default_filters=['decode.utf8'],
module_directory='/tmp/',
encoding_errors='replace')
path = rb.find_plugin_file(plugin,
'tmpl/artistartsearch-tmpl.html')
self.artist_template = Template(filename=path,
default_filters=['decode.utf8'],
module_directory='/tmp/',
encoding_errors='replace')
self.styles = rb.find_plugin_file(plugin, 'tmpl/main.css')
开发者ID:Hunsu,项目名称:coverart-browser,代码行数:25,代码来源:coverart_search.py
示例5: __init__
def __init__(self, plugin, sprite_name, size=None):
self.plugin = plugin
self.popups = rb.find_plugin_file(plugin, self.popups)
self.tree = ET.ElementTree(file=self.popups)
root = self.tree.getroot()
base = 'spritesheet[@name="' + sprite_name + '"]/'
image = rb.find_plugin_file(plugin, 'img/' +
root.findall(base + 'image')[0].text)
icon_width = int(root.findall(base + 'icon')[0].attrib['width'])
icon_height = int(root.findall(base + 'icon')[0].attrib['height'])
x_spacing = int(root.findall(base + 'spacing')[0].attrib['x'])
y_spacing = int(root.findall(base + 'spacing')[0].attrib['y'])
x_start = int(root.findall(base + 'start-position')[0].attrib['x'])
y_start = int(root.findall(base + 'start-position')[0].attrib['y'])
try:
alpha_color = map(int,
root.findall(base + 'alpha')[0].text.split(' '))
except:
alpha_color = None
self.names = []
for elem in root.findall(sprite_name + '/' + sprite_name +
'[@spritesheet="' + sprite_name + '"]'):
self.names.append(elem.attrib['name'])
self._sheet = SpriteSheet(image, icon_width, icon_height, x_spacing,
y_spacing, x_start, y_start, alpha_color, size)
开发者ID:fossfreedom,项目名称:cb_dev,代码行数:29,代码来源:coverart_utils.py
示例6: __init__
def __init__(self, plugin, sprite_name, size=None):
super(GenreConfiguredSpriteSheet, self).__init__(plugin, sprite_name,
size)
self.genre_alternate = {} # contains GenreType tuples
self._alt_icons = {}
self._sprite_name = sprite_name
self._size = size
popups = rb.find_plugin_file(plugin, 'img/popups.xml')
root = ET.parse(open(popups)).getroot()
self._parse_popups(plugin, root, self.GENRE_SYSTEM)
try:
self._user_popups = rb.find_plugin_file(plugin, 'img/usericons/popups.xml')
root = ET.parse(open(self._user_popups)).getroot()
self._parse_popups(plugin, root, self.GENRE_USER)
elem = root.xpath(self._sprite_name + '/index')
curr_index = long(elem[0].text)
for index in range(0,curr_index+1):
key = RB.ExtDBKey.create_lookup('icon', str(index))
icon_location = self._genre_db.lookup(key)
sprite = GdkPixbuf.Pixbuf.new_from_file(icon_location)
if self._size:
sprite = sprite.scale_simple(self._size[0], self._size[1],
GdkPixbuf.InterpType.BILINEAR)
self._alt_icons[str(index)] = sprite
self.names.append(str(index))
except:
pass
开发者ID:Jeff1981,项目名称:coverart-browser,代码行数:31,代码来源:coverart_utils.py
示例7: do_activate
def do_activate(self):
'''
Called by Rhythmbox when the plugin is activated. It creates the
plugin's source and connects signals to manage the plugin's
preferences.
'''
print("CoverArtBrowser DEBUG - do_activate")
self.shell = self.object
self.db = self.shell.props.db
try:
entry_type = CoverArtBrowserEntryType()
self.db.register_entry_type(entry_type)
except NotImplementedError:
entry_type = self.db.entry_register_type(
'CoverArtBrowserEntryType')
cl = CoverLocale()
cl.switch_locale(cl.Locale.LOCALE_DOMAIN)
entry_type.category = RB.RhythmDBEntryCategory.NORMAL
group = RB.DisplayPageGroup.get_by_id('library')
# load plugin icon
theme = Gtk.IconTheme.get_default()
rb.append_plugin_source_path(theme, '/icons')
# lets assume that python3 versions of RB only has the new icon attribute in the source
if rb3compat.PYVER >=3:
iconfile = Gio.File.new_for_path(
rb.find_plugin_file(self, 'img/' + Theme(self).current\
+ '/covermgr.png'))
self.source = CoverArtBrowserSource(
shell=self.shell,
name=_("CoverArt"),
entry_type=entry_type,
plugin=self,
icon=Gio.FileIcon.new(iconfile),
query_model=self.shell.props.library_source.props.base_query_model)
else:
what, width, height = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)
pxbf = GdkPixbuf.Pixbuf.new_from_file_at_size(
rb.find_plugin_file(self, 'img/' + Theme(self).current\
+ '/covermgr.png'), width, height)
self.source = CoverArtBrowserSource(
shell=self.shell,
name=_("CoverArt"), entry_type=entry_type,
plugin=self, pixbuf=pxbf,
query_model=self.shell.props.library_source.props.base_query_model)
self.shell.register_entry_type_for_source(self.source, entry_type)
self.shell.append_display_page(self.source, group)
self.source.props.query_model.connect('complete', self.load_complete)
print("CoverArtBrowser DEBUG - end do_activate")
开发者ID:coolono,项目名称:coverart-browser,代码行数:59,代码来源:coverart_browser.py
示例8: load_tmpl
def load_tmpl (self):
self.path = rb.find_plugin_file(self.plugin, 'tmpl/lyrics-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.template = Template (filename = self.path,
module_directory = '/tmp/context/')
self.loading_template = Template (filename = self.loading_path,
module_directory = '/tmp/context')
self.styles = self.basepath + '/tmpl/main.css'
开发者ID:wangd,项目名称:rhythmbox,代码行数:8,代码来源:LyricsTab.py
示例9: load_tmpl
def load_tmpl (self):
path = rb.find_plugin_file (self.plugin, 'tmpl/album-tmpl.html')
empty_path = rb.find_plugin_file (self.plugin, 'tmpl/album_empty-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.album_template = Template (filename = path)
self.loading_template = Template (filename = self.loading_path)
self.empty_template = Template (filename = empty_path)
self.styles = self.basepath + '/tmpl/artistmain.css'
开发者ID:Hunsu,项目名称:coverart-browser,代码行数:8,代码来源:coverart_artistinfo.py
示例10: load_tmpl
def load_tmpl (self):
self.path = rb.find_plugin_file (self.plugin, 'tmpl/album-tmpl.html')
self.loading_path = rb.find_plugin_file (self.plugin, 'tmpl/loading.html')
self.album_template = Template (filename = self.path,
module_directory = self.plugin.tempdir)
self.loading_template = Template (filename = self.loading_path,
module_directory = self.plugin.tempdir)
self.styles = self.basepath + '/tmpl/main.css'
开发者ID:dardevelin,项目名称:rhythmbox-shuffle,代码行数:8,代码来源:AlbumTab.py
示例11: do_activate
def do_activate (self):
ui = Gtk.Builder()
ui.add_from_file(rb.find_plugin_file(self,
'desktop-art.ui'))
window = ui.get_object('window')
window.set_app_paintable(True)
screen = window.get_screen()
visual = screen.get_rgba_visual()
self.composited = window.is_composited()
if visual !=None and self.composited:
window.set_visual(visual)
self.shell = self.object
player = self.shell.props.shell_player
window.stick()
window.set_keep_below(True)
desktop_control = DesktopControl(icons, self.shell, player,
rb.find_plugin_file(self,'configure-art.ui'), self)
cover_manager = CoverManager(player.props.db)
#player.props.db.connect_after("entry-extra-metadata-notify::rb:coverArt-uri", self.notify_metadata)
gc = GConf.Client.get_default()
gc.add_dir(GConf_plugin_path, GConf.ClientPreloadType.PRELOAD_NONE)
window_props = self.get_GConf_window_props(gc)
self.gc_notify_ids = [gc.notify_add(self.GConf_path('window_x'), self.GConf_cb, window_props),
gc.notify_add(self.GConf_path('window_y'), self.GConf_cb, window_props),
gc.notify_add(self.GConf_path('window_w'), self.GConf_cb, window_props),
gc.notify_add(self.GConf_path('window_h'), self.GConf_cb, window_props)]
window.add(desktop_control)
self.player = player
self.cb = player.connect('playing-changed', self.playing_changed, desktop_control, cover_manager)
self.playing_changed(player, player.get_playing(), desktop_control, cover_manager)
self.gc = gc
self.window = window
self.window_props = window_props
self.desktop_control = desktop_control
self.cover_manager = cover_manager
print("Adding timeout")
ret = GObject.timeout_add(POLL_TIMEOUT, self.poll_for_coverart)
print("integer id returned: " + str(ret))
self.position_window(self.window_props)
self.window.show_all()
else:
# We don't have compositing manager
md = Gtk.MessageDialog(type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.OK,
message_format='You are not running under a composited desktop-environment. The Desktop Art Plugin cannot work without one.')
md.run()
md.destroy()
开发者ID:andrenam,项目名称:desktop-art,代码行数:55,代码来源:desktop-art.py
示例12: load_tmpl
def load_tmpl(self):
cl = CoverLocale()
# cl.switch_locale(cl.Locale.LOCALE_DOMAIN)
path = rb.find_plugin_file(self.plugin, "tmpl/album-tmpl.html")
empty_path = rb.find_plugin_file(self.plugin, "tmpl/album_empty-tmpl.html")
self.loading_path = rb.find_plugin_file(self.plugin, "tmpl/loading.html")
self.album_template = Template(filename=path)
self.loading_template = Template(filename=self.loading_path)
self.empty_template = Template(filename=empty_path)
self.styles = self.basepath + "/tmpl/artistmain.css"
开发者ID:fossfreedom,项目名称:coverart-browser,代码行数:11,代码来源:coverart_artistinfo.py
示例13: __init__
def __init__(self, db, player, plugin):
RB.EntryView.__init__(self, db=db, shell_player=player)
self.db = db
self.plugin = plugin
self.pixs = [GdkPixbuf.Pixbuf.new_from_file(rb.find_plugin_file(self.plugin, 'pandora/widgets/star-off.png')),
GdkPixbuf.Pixbuf.new_from_file(rb.find_plugin_file(self.plugin, 'pandora/widgets/star-on.png'))]
player.connect_after('playing-changed', self.playing_changed)
self.load_columns()
开发者ID:bcbnz,项目名称:rhythmbox-pandora,代码行数:12,代码来源:SongEntryView.py
示例14: initialise
def initialise(self, plugin, callback, sort_order):
'''
set up the images we will use for this widget
'''
self.image_display = sort_order
self.set_tooltip(self.image_display)
if not self.is_initialised:
image1 = Gtk.Image.new_from_file(rb.find_plugin_file(plugin,
'img/arrow_up.png'))
image2 = Gtk.Image.new_from_file(rb.find_plugin_file(plugin,
'img/arrow_down.png'))
super(SortOrderButton, self).initialise(callback,
image1, image2)
开发者ID:fossfreedom,项目名称:cb_dev,代码行数:15,代码来源:coverart_widgets.py
示例15: _create_display_contents
def _create_display_contents(self, plugin):
print("DEBUG - create_display_contents")
# create the ui
self._first_run = True
builder = Gtk.Builder()
builder.add_from_file(rb.find_plugin_file(plugin,
'ui/spectrum_prefs.ui'))
builder.connect_signals(self)
gs = GSetting()
# bind the toggles to the settings
self.position = self.settings[gs.PluginKey.POSITION]
self.sidebar_position_radiobutton = builder.get_object('sidebar_position_radiobutton')
self.bottom_position_radiobutton = builder.get_object('bottom_position_radiobutton')
if self.position == 1:
self.sidebar_position_radiobutton.set_active(True)
else:
self.bottom_position_radiobutton.set_active(True)
self.builder = builder
# return the dialog
self._first_run = False
print("end create dialog contents")
return builder.get_object('main_grid')
开发者ID:fossfreedom,项目名称:rhythmbox-spectrum,代码行数:27,代码来源:spectrum_prefs.py
示例16: do_activate
def do_activate(self):
"""Activate the pandora plugin. Called when checked within the Rhythmbox plugin pane."""
print("Activating pandora plugin.")
shell = self.object
db = shell.props.db
entry_type = PandoraEntryType()
db.register_entry_type(entry_type)
_, width, height = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)
pandora_icon = GdkPixbuf.Pixbuf.new_from_file_at_size(rb.find_plugin_file(self, "pandora.png"), width, height)
self.source = GObject.new(
PandoraSource,
shell=shell,
name="Pandora",
plugin=self,
icon=pandora_icon,
entry_type=entry_type)
library_group = RB.DisplayPageGroup.get_by_id("library")
shell.append_display_page(self.source, library_group)
shell.register_entry_type_for_source(self.source, entry_type)
# hack, should be done within gobject constructor
self.source.init();
self.pec_id = shell.props.shell_player.connect_after('playing-song-changed', self.playing_entry_changed)
self.psc_id = shell.props.shell_player.connect_after('playing-source-changed', self.playing_source_changed)
开发者ID:bcbnz,项目名称:rhythmbox-pandora,代码行数:28,代码来源:__init__.py
示例17: do_activate
def do_activate(self):
print "CoverArtBrowser DEBUG - do_activate"
self.shell = self.object
self.db = self.shell.props.db
try:
entry_type = CoverArtBrowserEntryType()
self.db.register_entry_type(entry_type)
except NotImplementedError:
entry_type = db.entry_register_type("CoverArtBrowserEntryType")
entry_type.category = RB.RhythmDBEntryCategory.NORMAL
# load plugin icon
theme = Gtk.IconTheme.get_default()
rb.append_plugin_source_path(theme, "/icons")
what, width, height = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)
pxbf = GdkPixbuf.Pixbuf.new_from_file_at_size(rb.find_plugin_file(self, "covermgr.png"), width, height)
group = RB.DisplayPageGroup.get_by_id ("library")
self.source = GObject.new ( CoverArtBrowserSource,
shell=self.shell,
name=_("CoverArt"),
entry_type=entry_type,
plugin=self,
pixbuf=pxbf)
self.shell.register_entry_type_for_source(self.source, entry_type)
self.shell.append_display_page(self.source, group)
print "CoverArtBrowser DEBUG - end do_activate"
开发者ID:mateuswetah,项目名称:coverart-browser,代码行数:33,代码来源:coverart_browser.py
示例18: do_activate
def do_activate(self):
self.shell = self.object
self.sp = self.shell.props.shell_player
self.db = self.shell.get_property('db')
self.file = ""
self.basepath = 'file://' + os.path.split(rb.find_plugin_file(self, "AlbumArtSearch.py"))[0]
self.load_templates()
self.current_artist = None
self.current_album = None
self.current_song = None
self.current_location = None
self.visible = True
self.mode = self.MODE_FOLDER
self.init_gui()
self.connect_signals()
self.action = ('ToggleAlbumArtSearch', Gtk.STOCK_DND_MULTIPLE, _('Toggle album art search pane'),
None, _('Change the visibility of album art search pane'),
self.toggle_visibility, True)
self.action_group = Gtk.ActionGroup('AlbumArtSearchActions')
self.action_group.add_toggle_actions([self.action])
uim = self.shell.props.ui_manager
uim.insert_action_group (self.action_group, -1)
self.ui_id = uim.add_ui_from_string(albumart_search_ui)
uim.ensure_update()
开发者ID:echofourpapa,项目名称:rhythmbox-plugins,代码行数:30,代码来源:AlbumArtSearch.py
示例19: do_create_configure_widget
def do_create_configure_widget( self ):
#creamos un builder y agregamos el archivo de gui
builder = Gtk.Builder()
builder.add_from_file( rb.find_plugin_file( self, DIALOG_FILE ) )
if self.settings[Keys.CONNECTED]:
label_text = 'Logged'
button_label = 'Logout'
button_callback = self._logout
else:
label_text = 'Not Logged'
button_label = 'Login'
button_callback = self._login
#obtenemos los componentes del dialog a modificar
label = builder.get_object( LOGIN_LABEL )
button = builder.get_object( LOGIN_BUTTON )
playcount_checkbox = builder.get_object( PLAYCOUNT_CHECKBOX )
loved_checkbox = builder.get_object( LOVED_CHECKBOX )
#preparamos la gui
label.set_text( label_text )
button.set_label( button_label )
self._b_id = button.connect( 'clicked', button_callback, label )
playcount_checkbox.set_active( self.settings[Keys.PLAY_COUNT] )
playcount_checkbox.connect( 'toggled', self._toggle, Keys.PLAY_COUNT )
loved_checkbox.set_active( self.settings[Keys.LOVED] )
loved_checkbox.connect( 'toggled', self._toggle, Keys.LOVED )
return builder.get_object( DIALOG )
开发者ID:lucidlynx82,项目名称:lastfm_extension,代码行数:34,代码来源:LastFMExtensionGui.py
示例20: do_create_configure_widget
def do_create_configure_widget(self):
self.settings = Gio.Settings("org.gnome.rhythmbox.plugins.replaygain")
ui_file = rb.find_plugin_file(self, "replaygain-prefs.ui")
self.builder = Gtk.Builder()
self.builder.add_from_file(ui_file)
content = self.builder.get_object("replaygain-prefs")
combo = self.builder.get_object("replaygainmode")
combo.props.id_column = 1
self.settings.bind("mode", combo, "active-id", Gio.SettingsBindFlags.DEFAULT)
preamp = self.builder.get_object("preamp")
self.settings.bind("preamp", preamp.props.adjustment, "value", Gio.SettingsBindFlags.GET)
preamp.connect("value-changed", self.preamp_changed_cb)
preamp.add_mark(-15.0, Gtk.PositionType.BOTTOM, _("-15.0 dB"))
preamp.add_mark(0.0, Gtk.PositionType.BOTTOM, _("0.0 dB"))
preamp.add_mark(15.0, Gtk.PositionType.BOTTOM, _("15.0 dB"))
limiter = self.builder.get_object("limiter")
self.settings.bind("limiter", limiter, "active", Gio.SettingsBindFlags.DEFAULT)
return content
开发者ID:oddmutou,项目名称:rhythmbox,代码行数:25,代码来源:config.py
注:本文中的rb.find_plugin_file函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论