TeamHG-Memex / scrapy-rotating-proxies
Showing 1 of 1 files from the diff.

@@ -67,13 +67,13 @@
Loading
67 67
    def mark_dead(self, proxy, _time=None):
68 68
        """ Mark a proxy as dead """
69 69
        if proxy not in self.proxies:
70 -
            logger.warn("Proxy <%s> was not found in proxies list" % proxy)
70 +
            logger.warn("Proxy <%s> was not found in proxies list" % self._clean_proxy(proxy))
71 71
            return
72 72
73 73
        if proxy in self.good:
74 -
            logger.debug("GOOD proxy became DEAD: <%s>" % proxy)
74 +
            logger.debug("GOOD proxy became DEAD: <%s>" % self._clean_proxy(proxy))
75 75
        else:
76 -
            logger.debug("Proxy <%s> is DEAD" % proxy)
76 +
            logger.debug("Proxy <%s> is DEAD" % self._clean_proxy(proxy))
77 77
78 78
        self.unchecked.discard(proxy)
79 79
        self.good.discard(proxy)
@@ -88,11 +88,11 @@
Loading
88 88
    def mark_good(self, proxy):
89 89
        """ Mark a proxy as good """
90 90
        if proxy not in self.proxies:
91 -
            logger.warn("Proxy <%s> was not found in proxies list" % proxy)
91 +
            logger.warn("Proxy <%s> was not found in proxies list" % self._clean_proxy(proxy))
92 92
            return
93 93
94 94
        if proxy not in self.good:
95 -
            logger.debug("Proxy <%s> is GOOD" % proxy)
95 +
            logger.debug("Proxy <%s> is GOOD" % self._clean_proxy(proxy))
96 96
97 97
        self.unchecked.discard(proxy)
98 98
        self.dead.discard(proxy)
@@ -118,6 +118,10 @@
Loading
118 118
            self.dead.remove(proxy)
119 119
            self.unchecked.add(proxy)
120 120
121 +
    def _clean_proxy(self, proxy):
122 +
        """ Clean proxy so that it can be safely used in logs """
123 +
        return extract_proxy_hostport(proxy)
124 +
121 125
    @property
122 126
    def mean_backoff_time(self):
123 127
        if not self.dead:
Files Coverage
rotating_proxies 52.08%
Project Totals (5 files) 52.08%
53.1
TRAVIS_PYTHON_VERSION=2.7
TRAVIS_OS_NAME=linux
TOXENV=py27
53.3
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
TOXENV=py36
1
comment:
2
  layout: "header, diff, tree"
3

4
coverage:
5
  status:
6
    project: false
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading