def _ha_gen_method(func):
        ''' Method decorator for 'generator type' methods '''
        def wrapped(self, *args, **kw):
            self._reset_retries()
            while(True): # switch between all namenodes
                try:
                    results = func(self, *args, **kw)
                    while(True): # yield all results
                        yield results.next()
                except RequestError as e:
                    self.__handle_request_error(e)
                except socket.error as e:
                    self.__handle_socket_error(e)
        return wrapped
def _ha_gen_method ( func ) : def wrapped ( self , * args , ** kw ) : self . _reset_retries ( ) while ( True ) : try : results = func ( self , * args , ** kw ) while ( True ) : yield results . next ( ) except RequestError as e : self . __handle_request_error ( e ) except socket . error as e : self . __handle_socket_error ( e ) return wrapped
Method decorator for 'generator type' methods