# D-Bus signal implemented with dasbus library does not show up

**URL:** <https://discuss.python.org/t/d-bus-signal-implemented-with-dasbus-library-does-not-show-up/49626>\
**Category:** Python Help\
**Created:** [March 27, 2024, 8:05am UTC](https://discuss.python.org/t/d-bus-signal-implemented-with-dasbus-library-does-not-show-up/49626 "2024-03-27T08:05:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhneifer](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mhneifer/32/6151_2.png) [@mhneifer](https://discuss.python.org/u/mhneifer)\
**Post date:** [March 27, 2024, 8:05am UTC](https://discuss.python.org/t/d-bus-signal-implemented-with-dasbus-library-does-not-show-up/49626/1 "2024-03-27T08:05:21Z")

</div>

Hello. I’m trying to implement a simple D-Bus server mock using the [dasbus](https://github.com/dasbus-project/dasbus) library. I need to implement a D-Bus signal with a specific signature for testing purposes.

I tried to adjust one of the dasbus examples ([05\_chat](https://github.com/dasbus-project/dasbus/tree/master/examples/05_chat)). However, when I check my adjusted service with d-feet, the signal does not show up. See code below.

Could somebody please help me and give some hints what could be wrong with my code. Thanks in advance.

```python
"""
This is how it should look like:
<node>
  <interface name="org.example.ExampleService">
    <signal name="calculationDone">
      <arg name="requestId" type="i" direction="out"/>
      <arg name="frameNo" type="u" direction="out"/>
      <arg name="probabilities" type="ad" direction="out"/>
    </signal>
  </interface>
</node>
"""

from dasbus.connection import SessionMessageBus
from dasbus.identifier import DBusServiceIdentifier
from dasbus.loop import EventLoop
from dasbus.server.interface import dbus_interface, dbus_signal
from dasbus.server.publishable import Publishable
from dasbus.server.template import InterfaceTemplate
from dasbus.signal import Signal
from dasbus.xml import XMLGenerator

SESSION_BUS = SessionMessageBus()
EXAMPLE_SERVICE_NAMESPACE = ("org", "example", "ExampleService")
EXAMPLE_SERVICE = DBusServiceIdentifier(
    namespace=EXAMPLE_SERVICE_NAMESPACE, message_bus=SESSION_BUS
)

@dbus_interface(EXAMPLE_SERVICE.interface_name)
class ExampleServiceInterface(InterfaceTemplate):

    def connect_signals(self):
        self.implementation.calculation_done.connect(self.calculationDone)

    @dbus_signal
    def calculationDone(self):
        #return (1, 2, [0.1, 0.2, 0.3])
        print("calculationDone")

class ExampleService(Publishable):

    def __init__ (self):
        self._calculation_done = Signal()

    def for_publication(self):
        return ExampleServiceInterface(self)

    @property
    def calculation_done(self):
        return self._calculation_done

if __name__ == " __main__":
    print(XMLGenerator.prettify_xml(ExampleServiceInterface. __dbus_xml__ ))

    try:
        example_service = ExampleService()

        SESSION_BUS.publish_object(
            EXAMPLE_SERVICE.object_path, example_service.for_publication()
        )
        SESSION_BUS.register_service(EXAMPLE_SERVICE.service_name)

        loop = EventLoop()
        loop.run()
    finally:
        SESSION_BUS.disconnect()

```

Output is as follows:

```xml
<node>
  <!--Specifies ExampleServiceInterface-->
  <interface name="org.example.ExampleService"></interface>
</node>

```

The signal is missing.
