I would like to make custom events to be listened to by the `qubes.events.EventsDispatcher`.
So currently, if I would like to do something on domain startup I could do something like this: ``` import qubesadmin.events import qubesadmin import asyncio def print_starting_domain(*args, **kwargs): print(args) print(kwargs) qubes = qubesadmin.Qubes() dispatcher = qubesadmin.events.EventsDispatcher(qubes) dispatcher.add_handler("domain-start", print_start_domain) loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete( asyncio.ensure_future(dispatcher.listen_for_events()) ) loop.run_forever() ``` This code allows me to handle and get the vm information on startup. Now, I would like to do something similar but add my custom event (e.g. handle-vm-network). I found that (AppVM, TemplateVM, AdminVM, DispVM, and StandaloneVM) under qubes.vm are childs of qubes.events.Emitter. So, I would like to use something as follow and receive the event using qubes.events.EventsDispatcher. ``` import qubes class MyClass(qubes.events.Emitter): def __init__(self) -> None: super().__init__() self.events_enabled = True my_class = MyClass() my_class.fire_event('handle-vm-network') ``` Now, I would like to see the handle-vm-network event in my previous code. Is there away to do so? -- You received this message because you are subscribed to the Google Groups "qubes-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-devel/CAA-3NOCzNDSWQ0YOdS8q-10Gu8LjvaZ1FfO3oZVLbkJdi%3DifCA%40mail.gmail.com.