def _get_step_matches(self, text):
buffer = readline.get_line_buffer()
tail = buffer.rsplit(".", 1)[0]
matches = []
if tail:
obj_class = self.shell.run_command("{}.getClass()".format(tail))[0].split(" ")[-1]
obj_classname = obj_class.split(".")[-1]
if obj_classname == "DefaultGraphTraversal":
matches += self.shell.run_command("GraphTraversal.class.methods.name.unique()")
matches += self.shell.run_command("GraphTraversal.metaClass.methods.name.unique()")
matches += self.shell.run_command("getBinding().getVariable(\"sessionSteps\").keySet()")
else:
matches += self.shell.run_command("{}.getMethods().name.unique()".format(obj_class))
return [match for match in matches if match.startswith(text)]
评论列表
文章目录