def is_critical_stop(self): """ Is we has critical sign for immidiately stop? :return: """ return Registry().get('proxy_many_died') or Registry().get( 'positive_limit_stop') or ErrorsCounter.is_limit()
def output(self): """ Print output in the end of work :return: """ if Registry().get('proxy_many_died'): self.logger.log("Proxy many died, stop scan") self.work_end_error() if Registry().get('positive_limit_stop'): self.logger.log( "\nMany positive detections. Please, look items logs") self.logger.log("Last items:") for i in range(1, 5): self.logger.log(self.result[-i]) self.work_end_error() if ErrorsCounter.is_limit(): self.logger.log("\nToo many errors") self.work_end_error()