Browse Source

qubes/events: fix event handlers ordering

Since "qubes: fix event framework", handlers from extensions looks the
same as from the VM class itself, so it isn't possible to order them
correctly. Specification says:

    For each class first are called bound handlers (specified in class
    definition), then handlers from extensions. Aside from above,
    remaining order is undefined.

So, restore this property, which is later correctly used to order
handlers.
Marek Marczykowski-Górecki 7 years ago
parent
commit
73d61bb378
1 changed files with 2 additions and 0 deletions
  1. 2 0
      qubes/events.py

+ 2 - 0
qubes/events.py

@@ -50,6 +50,8 @@ def handler(*events):
     def decorator(func):
         # pylint: disable=missing-docstring
         func.ha_events = events
+        # mark class own handler (i.e. not from extension)
+        func.ha_bound = True
         return func
 
     return decorator