(self)
| 33 | self.proxy_handler = ProxyHandler() |
| 34 | |
| 35 | def run(self): |
| 36 | self.log.info("ProxyFetch - {func}: start".format(func=self.fetch_source)) |
| 37 | try: |
| 38 | for proxy in self.fetcher(): |
| 39 | self.log.info('ProxyFetch - %s: %s ok' % (self.fetch_source, proxy.ljust(23))) |
| 40 | proxy = proxy.strip() |
| 41 | if proxy in self.proxy_dict: |
| 42 | self.proxy_dict[proxy].add_source(self.fetch_source) |
| 43 | else: |
| 44 | self.proxy_dict[proxy] = Proxy( |
| 45 | proxy, source=self.fetch_source) |
| 46 | except Exception as e: |
| 47 | self.log.error("ProxyFetch - {func}: error".format(func=self.fetch_source)) |
| 48 | self.log.error(str(e)) |
| 49 | |
| 50 | |
| 51 | class Fetcher(object): |
nothing calls this directly
no test coverage detected