qubes/devices: calculate event names using +

This make static analysis of the events easier.
This commit is contained in:
Wojtek Porczyk 2016-03-21 11:42:20 +01:00
parent 349e218638
commit c375334c54

View File

@ -59,10 +59,9 @@ class DeviceCollection(object):
raise KeyError( raise KeyError(
'device {!r} of class {} already attached to {!r}'.format( 'device {!r} of class {} already attached to {!r}'.format(
device, self._class, self._vm)) device, self._class, self._vm))
self._vm.fire_event_pre('device-pre-attach:{}'.format(self._class), self._vm.fire_event_pre('device-pre-attach' + self._class, device)
device)
self._set.add(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): def detach(self, device):
@ -75,10 +74,9 @@ class DeviceCollection(object):
raise KeyError( raise KeyError(
'device {!r} of class {} not attached to {!r}'.format( 'device {!r} of class {} not attached to {!r}'.format(
device, self._class, self._vm)) device, self._class, self._vm))
self._vm.fire_event_pre('device-pre-detach:{}'.format(self._class), self._vm.fire_event_pre('device-pre-detach:{}' + self._class, device)
device)
self._set.remove(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): def __iter__(self):