本文整理汇总了Python中page.Page.process_node方法的典型用法代码示例。如果您正苦于以下问题:Python Page.process_node方法的具体用法?Python Page.process_node怎么用?Python Page.process_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.process_node方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import process_node [as 别名]
class Main(object):
def __init__(self, delegate, input):
self.delegate = delegate
self.input = input
self.work = []
self.page = Page()
def run(self):
try:
while not self.input.closed:
line = self.input.readline()
if line is None or line.strip() == EOF:
break
line = line.strip()
if line:
self.process_line(line)
except KeyboardInterrupt:
pass
except StandardError:
print "UI process input loop received exception:"
import traceback
traceback.print_exc()
finally:
self.delegate.exit()
def process_line(self, line):
node = Data.decode(line)
self.page.process_node(node)
self.delegate.update(self.page)
示例2: Main
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import process_node [as 别名]
class Main(object):
def __init__(self, delegate, queue):
self.delegate = delegate
self.queue = queue
self.work = []
self.page = Page()
def run(self):
try:
while True:
node = self.queue.get()
self.page.process_node(node)
self.delegate.update(self.page)
except KeyboardInterrupt:
pass
except StandardError:
print "UI process input loop received exception:"
import traceback
traceback.print_exc()
finally:
self.delegate.exit()