def _commands(self):
        dummy = NoCommand(self.protocol)

        cmds = []
        for d in self.protocol.environment['PATH'].split(':'):
            for i in dummy.traverse(d) or []:
                if ICommand.providedBy(i):
                    cmds.append(i.cmd)
        return cmds
 def pretty_name(item):
     if IContainer.providedBy(item):
         return self.protocol.colorize(BLUE, '%s/' % (item.__name__, ))
     elif ICommand.providedBy(item):
         return self.protocol.colorize(GREEN, '%s*' % (item.__name__, ))
     elif isinstance(item, Symlink):
         return self.protocol.colorize(CYAN, '%s@' % (item.__name__, ))
     else:
         return item.__name__
 def suffix(obj):
     if IContainer.providedBy(follow_symlinks(obj)):
         return '/'
     elif ICommand.providedBy(follow_symlinks(obj)):
         return '*'
     elif isinstance(obj, Symlink):
         return '@'
     else:
         return ''
    def _commands(self):
        dummy = NoCommand(self.protocol)

        cmds = []
        for d in self.protocol.environment['PATH'].split(':'):
            for i in dummy.traverse(d) or []:
                if ICommand.providedBy(i):
                    cmds.append(i.cmd)
        return cmds
 def pretty_name(item):
     if IContainer.providedBy(item):
         return self.protocol.colorize(BLUE, '%s/' % (item.__name__,))
     elif ICommand.providedBy(item):
         return self.protocol.colorize(GREEN, '%s*' % (item.__name__,))
     elif isinstance(item, Symlink):
         return self.protocol.colorize(CYAN, '%s@' % (item.__name__,))
     else:
         return item.__name__
    def _scan_search_path(self, protocol):
        dummy = commands.NoCommand(protocol)

        cmds = []
        for d in protocol.environment['PATH'].split(':'):
            for i in dummy.traverse(d) or []:
                if ICommand.providedBy(i):
                    cmds.append(i.cmd.name)

        return set(cmds)