本文整理汇总了Python中dispatcher.Dispatcher.set_urls方法的典型用法代码示例。如果您正苦于以下问题:Python Dispatcher.set_urls方法的具体用法?Python Dispatcher.set_urls怎么用?Python Dispatcher.set_urls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dispatcher.Dispatcher
的用法示例。
在下文中一共展示了Dispatcher.set_urls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StartDispatcher
# 需要导入模块: from dispatcher import Dispatcher [as 别名]
# 或者: from dispatcher.Dispatcher import set_urls [as 别名]
def StartDispatcher():
#with daemon.DaemonContext():
# try:
if True:
if True:
dispatcher = Dispatcher(
address='localhost',
exchange='barkingowl',
self_dispatch=False,
DEBUG=True
)
url = {
#'target_url': "http://timduffy.me/",
'target_url': "http://henrietta.org/",
'doc_types': [
#'application/pdf',
'*',
],
#'title': "TimDuffy.Me",
'title': 'Town of Henrietta, NY',
#'description': "Tim Duffy's Personal Website",
'description': "Town of Henrietta, NY Website.",
#'max_link_level': 1,
'max_link_level': 1,
'creation_datetime': str(datetime.datetime.now()),
'allowed_domains': [
],
'sleep_time': 0, # 1 secon
}
urls = []
urls.append(url)
print "Seting URLs ..."
dispatcher.set_urls(urls)
print "Done."
# note: blocking
print "Starting dispatcher ..."
dispatcher.start()
print "Done."