コード例 #1
0
ファイル: scp_shell.py プロジェクト: Duologic/python-deployer
        def __call__(self):
            host = get_host_func(self.shell)
            files = host.listdir()

            def iterator():
                for f in files:
                    if host.stat(f).is_dir:
                        yield colored(f, DirectoryType.color), len(f)
                    else:
                        yield f, len(f)

            console = Console(self.shell.pty)
            console.lesspipe(console.in_columns(iterator()))
コード例 #2
0
        def __call__(self):
            host = get_host_func(self.shell)
            files = host.listdir()

            def iterator():
                for f in files:
                    if host.stat(f).is_dir:
                        yield colored(f, DirectoryType.color), len(f)
                    else:
                        yield f, len(f)

            console = Console(self.shell.pty)
            console.lesspipe(console.in_columns(iterator()))
コード例 #3
0
ファイル: cli.py プロジェクト: Duologic/python-deployer
    def print_all_completions(self, all_completions):
        self.stdout.write('\r\n')

        # Create an iterator which yields all the comments (in their color),
        # and pass it through in_columns/lesspipe
        def column_items():
            for w in all_completions:
                handler_type = w[1].handler_type
                text = '%s%s' % (
                    termcolor.colored(w[0], handler_type.color),
                    termcolor.colored(handler_type.postfix, handler_type.postfix_color))
                length = len(w[0]) + len(handler_type.postfix)
                yield text, length

        c = Console(self.pty)
        c.lesspipe(c.in_columns(column_items()))
コード例 #4
0
ファイル: cli.py プロジェクト: trubachoff/python-deployer
    def print_all_completions(self, all_completions):
        self.stdout.write('\r\n')

        # Create an iterator which yields all the comments (in their color),
        # and pass it through in_columns/lesspipe
        def column_items():
            for w in all_completions:
                handler_type = w[1].handler_type
                text = '%s%s' % (termcolor.colored(w[0], handler_type.color),
                                 termcolor.colored(handler_type.postfix,
                                                   handler_type.postfix_color))
                length = len(w[0]) + len(handler_type.postfix)
                yield text, length

        c = Console(self.pty)
        c.lesspipe(c.in_columns(column_items()))
コード例 #5
0
ファイル: scp_shell.py プロジェクト: Duologic/python-deployer
 def __call__(self):
     files = self.shell.localhost.listdir()
     console = Console(self.shell.pty)
     console.lesspipe(console.in_columns(files))
コード例 #6
0
 def __call__(self):
     files = self.shell.localhost.listdir()
     console = Console(self.shell.pty)
     console.lesspipe(console.in_columns(files))