本文整理汇总了Python中py2neo.Node.update方法的典型用法代码示例。如果您正苦于以下问题:Python Node.update方法的具体用法?Python Node.update怎么用?Python Node.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mass_Import_WX_ID_from_opml
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import update [as 别名]
def mass_Import_WX_ID_from_opml(self, opemlFile_or_Content_or_URL):
'''
listparser.parse(obj[, agent, etag, modified])
Parameters:
obj (file or string) – a file-like object or a string containing a URL, an absolute or relative filename, or an XML document
agent (string) – User-Agent header to be sent when requesting a URL
etag (string) – ETag header to be sent when requesting a URL
modified (string or datetime) – Last-Modified header to be sent when requesting a URL
'''
opml = listparser.parse(opemlFile_or_Content_or_URL)
for feed in opml.feeds:
try:
wx_id=re.findall("weixin\?id=(\S+)$", feed.url)[0]
except IndexError:
print "---- WX_ID Paste Error!%s"%feed.url
if not self.is_WX_ID_Exists(wx_id):
WX_ID = Node("WX_ID")
info = {
"wx_id": wx_id,
"name": feed.title,
"group": feed.categories[0][0]
}
WX_ID.update(info)
self.neo4j.create(WX_ID)
print "++++ WX_ID Simple stored:\t%s" % wx_id
return True
示例2: create_WX_ID
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import update [as 别名]
def create_WX_ID(self, wx_id_info):
'''
CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
CREATE (Hugo:Person {name:'Hugo Weaving', born:1960})
'''
if not self.is_WX_ID_Exists(wx_id_info['wx_id']):
wxid1 = Node("WX_ID")
wxid1.update(wx_id_info)
self.neo4j.create(wxid1)
print "++++ WX_ID stored:\t%s" % wx_id_info['wx_id']
return True