altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 59 forks source link

update the re pattern for valid name assertion #98

Closed rtgiskard closed 2 years ago

rtgiskard commented 2 years ago

For gtk application(tested with Gtk-3.0), generally the registered dbus interface include snippet like this:

<interface name="org.gtk.Application">
<method name="Activate">
  <arg type="a{sv}" name="platform-data" direction="in">
  </arg>
</method>

Currently the member name is matched with the pattern in validators.py:

_elementre = re.compile(r'^[A-Za-z][A-Za-z0-9_]*$')

For which name with dash like platform-data will be invalid, the pattern need to be update to support gtk application

rtgiskard commented 2 years ago

according to the specification, the original behaviour is right, however Gtk currently does not follow the specification, the patch may be present as a temporary solution for the existing gtk applications

acrisci commented 2 years ago

:+1: