什么原因导致了严重的 glib 错误(使用消息菜单编码时)?

什么原因导致了严重的 glib 错误(使用消息菜单编码时)?

如果我运行下面的python代码(几乎完全来自这篇有用的博客文章) 然后我在终端中收到三条相同的令人讨厌的错误消息。 是什么原因造成的?

我注意到这个数字(下面例子中的 5857)在每次运行时都会略有变化。这个数字代表什么?它是内存位置还是类似的东西?

(messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: 断言“error_name != NULL && g_dbus_is_name (error_name)”失败

(messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: 断言“error_name != NULL && g_dbus_is_name (error_name)”失败

(messaging-menu.py:5857): GLib-GIO-CRITICAL **: g_dbus_method_invocation_return_dbus_error: 断言“error_name != NULL && g_dbus_is_name (error_name)”失败

我正在 Natty 上运行它,我应该看看在 10.10 中是否会出现同样的错误......

import gtk

def show_window_function(x, y):
    print x
    print y

# get the indicate module, which does all the work
import indicate

# Create a server item
mm = indicate.indicate_server_ref_default()
# If someone clicks your server item in the MM, fire the server-display signal
mm.connect("server-display", show_window_function)
# Set the type of messages that your item uses. It's not at all clear which types
# you're allowed to use, here.
mm.set_type("message.im")
# You must specify a .desktop file: this is where the MM gets the name of your
# app from.
mm.set_desktop_file("/usr/share/applications/nautilus.desktop")
# Show the item in the MM.
mm.show()

# Create a source item
mm_source = indicate.Indicator()
# Again, it's not clear which subtypes you are allowed to use here.
mm_source.set_property("subtype", "im")
# "Sender" is the text that appears in the source item in the MM
mm_source.set_property("sender", "Unread")
# If someone clicks this source item in the MM, fire the user-display signal
mm_source.connect("user-display", show_window_function)
# Light up the messaging menu so that people know something has changed
mm_source.set_property("draw-attention", "true")
# Set the count of messages in this source.
mm_source.set_property("count", "15")
# If you prefer, you can set the time of the last message from this source,
# rather than the count. (You can't set both.) This means that instead of a
# message count, the MM will show "2m" or similar for the time since this
# message arrived.
# mm_source.set_property_time("time", time.time())
mm_source.show()

gtk.main()

答案1

在 Maverick 上进行的测试表明这是一个 Natty 错误,所以我报告了一个错误

相关内容