You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to run through dbus-session-run python dbus_endpoint.py, I get the following error:
File "dbus_endpoint.py", line 39, in <module>
bus.publish(dbus_path, DbusEndpoint(dbus_path))
File "/usr/local/lib/python2.7/dist-packages/pydbus/publication.py", line 42, in publish
return Publication(self, bus_name, *objects)
File "/usr/local/lib/python2.7/dist-packages/pydbus/publication.py", line 32, in __init__
self._at_exit(bus.register_object(path, object, node_info).__exit__)
File "/usr/local/lib/python2.7/dist-packages/pydbus/registration.py", line 152, in register_object
node_info = [Gio.DBusNodeInfo.new_for_xml(ni) for ni in node_info]
GLib.Error: g-markup-error-quark: 1:1: Error on line 1 char 1: Document must begin with an element (e.g. <book>) (2)
Contents of dbus_endpoints.py
from gi.repository import GLib
from pydbus import SessionBus
class DbusEndpoint:
"""
<node>
<interface name='org.matcher.keywords'>
<method name='match_keywords'>
<arg type='as' name='keywords' direction='in' />
<arg type='s' name='data' direction='in' />
<arg type='as' name='response' direction='out' />
</method>
</interface>
</node>
"""
def __init__(self, dbus_path):
self.my_dbus_path = dbus_path
def match_keywords(self, keywords, data):
return [keyword for keyword in keywords if keyword in data]
if __name__ == '__main__':
loop = GLib.MainLoop()
bus = SessionBus()
dbus_path = 'org.matcher.keywords'
bus.publish(dbus_path, DbusEndpoint(dbus_path))
loop.run()
The text was updated successfully, but these errors were encountered:
When trying to run through
dbus-session-run python dbus_endpoint.py
, I get the following error:Contents of dbus_endpoints.py
The text was updated successfully, but these errors were encountered: