本文整理汇总了Python中checker.Checker.start方法的典型用法代码示例。如果您正苦于以下问题:Python Checker.start方法的具体用法?Python Checker.start怎么用?Python Checker.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类checker.Checker
的用法示例。
在下文中一共展示了Checker.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from checker import Checker [as 别名]
# 或者: from checker.Checker import start [as 别名]
def main(args):
with codecs.open(args.props, 'r', encoding='utf-8') as f:
meta = json.loads(f.read())
logging.info('Creating dataset instance')
ds = Dataset(meta['database'])
logging.info('Creating scrapper instance')
spr1 = SiteScrapper(meta['scrapper'], phantomjs='phantomjs1')
spr2 = SiteScrapper(meta['scrapper'], phantomjs='phantomjs2')
logging.info('Creating manager instance')
mgr1 = Manager(ds, spr1, meta['conf'])
mgr2 = Manager(ds, spr2, meta['conf'])
threads = []
crawler = Crawler(mgr1)
crawler.daemon = True
crawler.start()
threads.append(crawler)
checker = Checker(mgr2)
checker.daemon = True
checker.start()
threads.append(checker)
# for th in threads:
# th.join()
while True:
pass
示例2: __init__
# 需要导入模块: from checker import Checker [as 别名]
# 或者: from checker.Checker import start [as 别名]
def __init__( self ):
logging.debug( 'Initialize' )
for addr in conf.evil_ip_list:
checker = Checker( addr )
checker.start()