Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def onCallback(*args):
     self.calls[name] = args
     return BaseGame.__getattribute__(self, name)(*args)
Exemplo n.º 4
0
 def onCallback(*args):
     self.calls[name] = args
     return BaseGame.__getattribute__(self, name)(*args)