Пример #1
0
 def __getattribute__(self, name):
     """Intercept all observer notifications for functions named on*() and
     store the arguments."""
     if name.startswith('on'):
         def onCallback(*args):
             self.calls[name] = args
             return BaseGame.__getattribute__(self, name)(*args)
         return onCallback
     return BaseGame.__getattribute__(self, name)
Пример #2
0
    def __getattribute__(self, name):
        """Intercept all observer notifications for functions named on*() and
        store the arguments."""
        if name.startswith('on'):

            def onCallback(*args):
                self.calls[name] = args
                return BaseGame.__getattribute__(self, name)(*args)

            return onCallback
        return BaseGame.__getattribute__(self, name)
Пример #3
0
 def onCallback(*args):
     self.calls[name] = args
     return BaseGame.__getattribute__(self, name)(*args)
Пример #4
0
 def onCallback(*args):
     self.calls[name] = args
     return BaseGame.__getattribute__(self, name)(*args)