本文整理匯總了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()