当前位置: 首页>>代码示例>>Python>>正文


Python Graph.open_browser方法代码示例

本文整理汇总了Python中py2neo.Graph.open_browser方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.open_browser方法的具体用法?Python Graph.open_browser怎么用?Python Graph.open_browser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在py2neo.Graph的用法示例。


在下文中一共展示了Graph.open_browser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: neo4ida_t

# 需要导入模块: from py2neo import Graph [as 别名]
# 或者: from py2neo.Graph import open_browser [as 别名]
class neo4ida_t(idaapi.plugin_t):
	flags = 0
	comment = "Neo4j graph export and query interface"
	help = "Neo4j graph export and query interface"
	wanted_name = "Neo4IDA"
	wanted_hotkey = ""

	def init(self):
		self.conf_file = os.path.expanduser("~") + os.path.sep + "neo4ida.json"
		config = self.get_config()
		if not config:
			config = self.create_default_config()
		self.connect()
		action = UiAction(
			id="neo4ida:upload",
			name="Upload",
			tooltip="Upload to neo4j",
			menuPath="Edit/neo4ida/",
			callback=self.upload,
			icon=""
		)
		if not action.registerAction():
			return 1
		action = UiAction(
			id="neo4ida:dropdb",
			name="Drop Database",
			tooltip="Delete all entries in database instance.",
			menuPath="Edit/neo4ida/",
			callback=self.drop_db,
			icon=""
		)
		if not action.registerAction():
			return 1
		action = UiAction(
			id="neo4ida:config",
			name="Configure",
			tooltip="Configure neo4j connection details.",
			menuPath="Edit/neo4ida/",
			callback=self.config_form,
			icon=""
		)
		if not action.registerAction():
			return 1
		action = UiAction(
			id="neo4ida:query",
			name="Cypher Query",
			tooltip="Execute a Cypher query.",
			menuPath="Edit/neo4ida/",
			callback=self.query_form,
			icon=""
		)
		if not action.registerAction():
			return 1
		action = UiAction(
			id="neo4ida:browser",
			name="Neo4j Browser",
			tooltip="Open Neo4j browser.",
			menuPath="Edit/neo4ida/",
			callback=self.open_browser,
			icon=""
		)
		if not action.registerAction():
			return 1
		action = UiAction(
			id="neo4ida:diff",
			name="Binary Diff",
			tooltip="Open binary diffing interface.",
			menuPath="Edit/neo4ida/",
			callback=self.binary_diff,
			icon=""
		)
		if not action.registerAction():
			return 1
		return idaapi.PLUGIN_KEEP

		
	def connect(self):
		conf = self.get_config()
		authenticate(conf['host'] + ":" + conf['port'],conf['username'],conf["password"])
		try:
			self.neo = Graph("http://" + conf['host'] + ":" + conf["port"] + "/db/data")
		except:
			print "Failed to connect!"
	
	def term(self):
		return None

	def binary_diff(self,ctf):
		print "Open binary diffing interface"

	def drop_db(self,ctx):
		self.neo.cypher.execute("START n=node(*) detach delete n;")
		print "All database nodes and relationships deleted."
	
	def open_browser(self,ctx):
		self.neo.open_browser()
	
	def config_form(self,ctx):
		ConnectionManagementForm(self)
	
#.........这里部分代码省略.........
开发者ID:chubbymaggie,项目名称:ida-scripts-1,代码行数:103,代码来源:neo4ida.py


注:本文中的py2neo.Graph.open_browser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。