octopus_rlcompleter.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:octopus 作者: octopus-platform 项目源码 文件源码
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)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号