(self)
| 101 | self.errors = 0 |
| 102 | |
| 103 | def run(self): |
| 104 | for _i in range(self.nrequests_per_thread): |
| 105 | try: |
| 106 | get(self.urls) |
| 107 | except Exception as e: |
| 108 | print(e) |
| 109 | |
| 110 | if not self.options.continue_: |
| 111 | thread.interrupt_main() |
| 112 | thread.exit() |
| 113 | |
| 114 | self.errors += 1 |
| 115 | |
| 116 | with URLGetterThread.counter_lock: |
| 117 | URLGetterThread.counter += 1 |
| 118 | counter = URLGetterThread.counter |
| 119 | |
| 120 | should_print = self.options.verbose and not counter % 1000 |
| 121 | |
| 122 | if should_print: |
| 123 | print(counter) |
| 124 | |
| 125 | |
| 126 | def main(options, mode, urls): |
no test coverage detected