execution.py 文件源码

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

项目:http-prompt 作者: eliangcs 项目源码 文件源码
def visit_ls(self, node, children):
        path = urlparse(self.context_override.url).path
        path = filter(None, path.split('/'))
        nodes = self.context.root.ls(*path)
        if self.output.isatty():
            names = []
            for node in nodes:
                token_type = String if node.data.get('type') == 'dir' else Name
                name = self._colorize(node.name, token_type)
                names.append(name)
            lines = list(colformat(list(names)))
        else:
            lines = [n.name for n in nodes]
        if lines:
            self.output.write('\n'.join(lines))
        return node
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号