From f9658ae3381c40a57f460ca9dedfc25f2365d7f0 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Wed, 17 Dec 2014 13:35:06 +0100 Subject: [PATCH] qubes/vm: remove old event methods that were overlooked --- qubes/vm/__init__.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py index df3c73af..f8cf4e06 100644 --- a/qubes/vm/__init__.py +++ b/qubes/vm/__init__.py @@ -296,32 +296,6 @@ class BaseVM(qubes.PropertyHolder): return '<{} object at {:#x} {}>'.format( self.__class__.__name__, id(self), ' '.join(proprepr)) - @classmethod - def add_hook(cls, event, f): - '''Add hook to entire VM class and all subclasses - - :param str event: event type - :param callable f: function to fire on event - - Prototype of the function depends on the exact type of event. Classes - which inherit from this class will also inherit the hook. - ''' - - cls.__hooks__[event].append(f) - - - def fire_hooks(self, event, *args, **kwargs): - '''Fire hooks associated with an event - - :param str event: event type - - *args* and *kwargs* are passed to each function - ''' - - for cls in self.__class__.__mro__: - if not hasattr(cls, '__hooks__'): continue - for hook in cls.__hooks__[event]: - hook(self, *args, **kwargs) def load(class_, D):