(self, fetcher_cls)
return wrapper
fetcher_cls: subclass of FetcherBase to be used
fetcher_cls: subclass of FetcherBase to be used
fetcher_cls : subclass of FetcherBase to be used
def __call__(self, fetcher_cls):
        """ fetcher_cls: subclass of FetcherBase to be used
        """
        self.fetcher_cls = fetcher_cls

        @wraps(fetcher_cls)
        def wrapper(res):
            assert isinstance(res, SearchResult)
            try:
                fetcher = fetcher_cls(res)
                fetcher.name = self.name
                fetcher.get_title()
                fetcher.get_meta()
                return fetcher
            except KeyboardInterrupt:
                raise
            except Exception:
                log_exc("Error in parser '{0}' with url '{1}'".
                        format(self.name, res.url))
                return None
        self.parser_dict[self.name] = self
        self.cb = wrapper
        return wrapper
def __call__ ( self , fetcher_cls ) : self . fetcher_cls = fetcher_cls @ wraps ( fetcher_cls ) def wrapper ( res ) : assert isinstance ( res , SearchResult ) try : fetcher = fetcher_cls ( res ) fetcher . name = self . name fetcher . get_title ( ) fetcher . get_meta ( ) return fetcher except KeyboardInterrupt : raise except Exception : log_exc ( "Error in parser '{0}' with url '{1}'" . format ( self . name , res . url ) ) return None self . parser_dict [ self . name ] = self self . cb = wrapper return wrapper