本文整理汇总了Python中gi.repository.GstPbutils.missing_plugin_message_get_installer_detail方法的典型用法代码示例。如果您正苦于以下问题:Python GstPbutils.missing_plugin_message_get_installer_detail方法的具体用法?Python GstPbutils.missing_plugin_message_get_installer_detail怎么用?Python GstPbutils.missing_plugin_message_get_installer_detail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GstPbutils
的用法示例。
在下文中一共展示了GstPbutils.missing_plugin_message_get_installer_detail方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def install(self):
"""
Install missing plugins
"""
try:
context = GstPbutils.InstallPluginsContext.new()
try:
context.set_desktop_id('lollypop.desktop')
except:
pass # Not supported by Ubuntu VIVID
details = []
for message in self._messages:
detail = \
GstPbutils.missing_plugin_message_get_installer_detail(
message)
details.append(detail)
GstPbutils.install_plugins_async(
details,
context,
self._null)
if Lp.notify is not None:
GLib.timeout_add(
10000,
Lp.notify.send,
_("Restart lollypop after installing codecs"))
except Exception as e:
print("Codecs::__init__(): %s" % e)
示例2: on_gst_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def on_gst_element(self, bus, message):
if GstPbutils.is_missing_plugin_message(message):
if GstPbutils.install_plugins_supported():
details = GstPbutils.missing_plugin_message_get_installer_detail(message)
GstPbutils.install_plugins_async([details,], None, self.on_gst_plugin_installed, None)
else:
self.error_dialog(_("Missing codec"), None,
submsg=_("GStreamer is missing a plugin and it could not be automatically installed. Either manually install it or try another quality setting."))
示例3: _on_element
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def _on_element(self, bus, message):
if GstPbutils.is_missing_plugin_message(message):
if GstPbutils.install_plugins_supported():
details = (
GstPbutils.missing_plugin_message_get_installer_detail(
message))
GstPbutils.install_plugins_async(
[details], None, self._plugin_installation_complete, None)
else:
self.emit("error", "Missing codec",
"GStreamer is missing a plugin and it could not be "
"automatically installed. Either manually install "
"it or try another quality setting.",
False)
示例4: __getMissingElement
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def __getMissingElement(self, message, window_id = 0):
if gst.pygst_version < (0, 10, 10):
print _("This version of gstreamer can't handle missing elements")
return
self.errors.append(str(message.structure["type"]))
self.errors.append(str(message.structure["detail"]))
self.errors.append(str(message.structure["name"]))
detail = pbutils.missing_plugin_message_get_installer_detail(message)
context = pbutils.InstallPluginsContext()
if window_id:
context.set_x_id(window_id)
msg = pbutils.install_plugins_async([detail], context,self.__pbutils_plugin_installed_cb)
示例5: on_message
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def on_message(self, bus, message):
mtype = message.type
# print(mtype)
if mtype == Gst.MessageType.ERROR:
print("we got an error, life is shit")
err, debug = message.parse_error()
print(err)
print(debug)
Gst.debug_bin_to_dot_file(self.pipeline, Gst.DebugGraphDetails.ALL, "transmageddon-debug-graph")
# self.emit('got-error', err.message)
elif mtype == Gst.MessageType.ELEMENT:
if GstPbutils.is_missing_plugin_message(message):
print("missing something")
if self.missingplugin == False: # don't think this is correct if more than one plugin installed
self.missingplugin = message
GstPbutils.missing_plugin_message_get_description(message)
GstPbutils.missing_plugin_message_get_installer_detail(message)
self.uridecoder.set_state(Gst.State.NULL)
self.emit("missing-plugin")
elif mtype == Gst.MessageType.ASYNC_DONE:
self.emit("ready-for-querying")
elif mtype == Gst.MessageType.EOS:
self.usedstreamids = []
# removing multipass cache file when done
if (self.streamdata["multipass"] != 0) and (self.streamdata["passcounter"] != self.streamdata["multipass"]):
if os.access(self.cachefile, os.F_OK):
os.remove(self.cachefile)
os.remove(self.cachefile + ".mbtree")
# print(self.streamdata['passcounter'])
self.emit("got-eos")
self.pipeline.set_state(Gst.State.NULL)
elif mtype == Gst.MessageType.APPLICATION:
self.pipeline.set_state(Gst.State.NULL)
self.pipeline.remove(self.uridecoder)
return True
示例6: __handle_plugin_missing_message
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def __handle_plugin_missing_message(message, engine):
desc = GstPbutils.missing_plugin_message_get_description(message)
installer_details = GstPbutils.missing_plugin_message_get_installer_detail(message)
LOGGER.warn("A plugin for %s is missing, stopping playback", desc)
user_message = _(
"A GStreamer 1.x plugin for %s is missing. "
"Without this software installed, Exaile will not be able to play the current file. "
"Please install the required software on your computer. See %s for details."
) % (desc, MISSING_PLUGIN_URL)
# TODO make URL clickable by utilizing xlgui.widgets.dialogs.MessageBar
engine.stop()
__notify_user_on_error(user_message, engine)
if GstPbutils.install_plugins_supported():
if __run_installer_helper(installer_details):
return
LOGGER.warn("Installation of GStreamer plugins not supported on this platform.")
示例7: _start_plugin_installation
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def _start_plugin_installation(self, missing_plugin_messages, confirm_search):
install_ctx = GstPbutils.InstallPluginsContext.new()
if self._gst_plugins_base_check_version(1, 5, 0):
install_ctx.set_desktop_id('gnome-music.desktop')
install_ctx.set_confirm_search(confirm_search)
startup_id = '_TIME%u' % Gtk.get_current_event_time()
install_ctx.set_startup_notification_id(startup_id)
installer_details = []
for message in missing_plugin_messages:
installer_detail = GstPbutils.missing_plugin_message_get_installer_detail(message)
installer_details.append(installer_detail)
def on_install_done(res):
# We get the callback too soon, before the installation has
# actually finished. Do nothing for now.
pass
GstPbutils.install_plugins_async(installer_details, install_ctx, on_install_done)
示例8: install
# 需要导入模块: from gi.repository import GstPbutils [as 别名]
# 或者: from gi.repository.GstPbutils import missing_plugin_message_get_installer_detail [as 别名]
def install(self):
"""
Install missing plugins
"""
try:
context = GstPbutils.InstallPluginsContext.new()
try:
context.set_desktop_id('lollypop.desktop')
except:
pass # Not supported by Ubuntu VIVID
details = []
for message in self._messages:
detail = \
GstPbutils.missing_plugin_message_get_installer_detail(
message)
details.append(detail)
GstPbutils.install_plugins_async(
details,
context,
self._null)
except Exception as e:
print("Codecs::__init__(): %s" % e)