qubes/devices: calculate event names using +
This make static analysis of the events easier.
This commit is contained in:
parent
349e218638
commit
c375334c54
@ -59,10 +59,9 @@ class DeviceCollection(object):
|
||||
raise KeyError(
|
||||
'device {!r} of class {} already attached to {!r}'.format(
|
||||
device, self._class, self._vm))
|
||||
self._vm.fire_event_pre('device-pre-attach:{}'.format(self._class),
|
||||
device)
|
||||
self._vm.fire_event_pre('device-pre-attach' + self._class, device)
|
||||
self._set.add(device)
|
||||
self._vm.fire_event('device-attach:{}'.format(self._class), device)
|
||||
self._vm.fire_event('device-attach' + self._class, device)
|
||||
|
||||
|
||||
def detach(self, device):
|
||||
@ -75,10 +74,9 @@ class DeviceCollection(object):
|
||||
raise KeyError(
|
||||
'device {!r} of class {} not attached to {!r}'.format(
|
||||
device, self._class, self._vm))
|
||||
self._vm.fire_event_pre('device-pre-detach:{}'.format(self._class),
|
||||
device)
|
||||
self._vm.fire_event_pre('device-pre-detach:{}' + self._class, device)
|
||||
self._set.remove(device)
|
||||
self._vm.fire_event('device-detach:{}'.format(self._class), device)
|
||||
self._vm.fire_event('device-detach' + self._class, device)
|
||||
|
||||
|
||||
def __iter__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user