def updateInfo(self, item, newlinks, oldlinks):
		'''爬虫爬完之后对数据库内容进行更新'''
		cur = self.conn.cursor()
		cur.execute("SELECT wid,did FROM Websites WHERE url=?", (item['url'],))
		wid, did = cur.fetchone()
		# website记录更新
		cur.execute("UPDATE Websites SET title=?,visited=1 WHERE wid=?", (item['title'], wid,))
		# 对应的domain记录中出度也需要更新
		cur.execute("UPDATE Domains SET outdegree=outdegree+? WHERE did=?", (len(item['links']), did,))

		# 对该网页中所有链接涉及的记录进行更新
		# 外部判断未出现过的链接
		for link,domain in newlinks:
			self.insertWebsite(link, domain)

		# 外部判断出现过的链接
		for link,domain in oldlinks:
			# 对对应的domain记录入度增加
			cur.execute("UPDATE Domains SET outdegree=outdegree+1 WHERE domain=?", (domain,))
		# 写入到文件
		self.conn.commit()
def _add_implementor(rpc_code, blocking, fn):

    # Validate the argument types.
    if type(rpc_code) is not int:
        raise TypeError("Expected int, got %r instead" % type(rpc_code))
    if type(blocking) is not bool:
        raise TypeError("Expected bool, got %r instead" % type(blocking))
    if not callable(fn):
        raise TypeError("Expected callable, got %r instead" % type(fn))

    # Validate the RPC code.
    if rpc_code in rpcMap:
        try:
            msg = "Duplicated RPC implementors for code %d: %s and %s"
            msg %= (rpc_code, rpcMap[rpc_code][0].__name__, fn.__name__)
        except Exception:
            msg = "Duplicated RPC implementors for code: %d" % rpc_code
        raise SyntaxError(msg)

    # TODO: use introspection to validate the function signature

    # Register the implementor.
    rpcMap[rpc_code] = (fn, blocking)

    # Return the implementor. No wrapping is needed! :)
    return fn