(self, cmdp)
return self.STATUS_OK
ps: list containers
        -m                         :print execution mode
        -s                         :print size in MB
ps: list containers
        -m                         :print execution mode
        -s                         :print size in MB
ps : list containers - m : print execution mode - s : print size in MB
def do_ps(self, cmdp):
        """
        ps: list containers
        -m                         :print execution mode
        -s                         :print size in MB
        """
        print_mode = cmdp.get("-m")
        print_size = cmdp.get("-s")
        if cmdp.missing_options():               # syntax error
            return self.STATUS_ERROR
        mod_h = size_h = ""
        mod_l = size_l = "%0s"
        if print_mode:
            mod_h = "MOD "
            mod_l = "%2.2s "
        if print_size:
            size_h = "SIZE "
            size_l = "%5.5s "
        fmt = "%-36.36s %c %c " + mod_h + size_h + "%-18s %-20.20s"
        Msg().out(fmt % ("CONTAINER ID", 'P', 'M', "NAMES", "IMAGE"))
        fmt = "%-36.36s %c %c " + mod_l + size_l + "%-18.100s %-20.100s"
        line = [''] * 7
        containers_list = self.localrepo.get_containers_list(False)
        for (line[0], line[6], line[5]) in containers_list:
            container_id = line[0]
            exec_mode = ExecutionMode(self.localrepo, container_id)
            line[3] = exec_mode.get_mode() if print_mode else ""
            line[1] = ('.', 'P')[
                self.localrepo.isprotected_container(container_id)]
            line[2] = ('R', 'W', 'N', 'D')[
                self.localrepo.iswriteable_container(container_id)]
            line[4] = self.localrepo.get_size(container_id) \
                    if print_size else ""
            Msg().out(fmt % tuple(line))
        return self.STATUS_OK
def do_ps ( self , cmdp ) : print_mode = cmdp . get ( "-m" ) print_size = cmdp . get ( "-s" ) if cmdp . missing_options ( ) : # syntax error return self . STATUS_ERROR mod_h = size_h = "" mod_l = size_l = "%0s" if print_mode : mod_h = "MOD " mod_l = "%2.2s " if print_size : size_h = "SIZE " size_l = "%5.5s " fmt = "%-36.36s %c %c " + mod_h + size_h + "%-18s %-20.20s" Msg ( ) . out ( fmt % ( "CONTAINER ID" , 'P' , 'M' , "NAMES" , "IMAGE" ) ) fmt = "%-36.36s %c %c " + mod_l + size_l + "%-18.100s %-20.100s" line = [ '' ] * 7 containers_list = self . localrepo . get_containers_list ( False ) for ( line [ 0 ] , line [ 6 ] , line [ 5 ] ) in containers_list : container_id = line [ 0 ] exec_mode = ExecutionMode ( self . localrepo , container_id ) line [ 3 ] = exec_mode . get_mode ( ) if print_mode else "" line [ 1 ] = ( '.' , 'P' ) [ self . localrepo . isprotected_container ( container_id ) ] line [ 2 ] = ( 'R' , 'W' , 'N' , 'D' ) [ self . localrepo . iswriteable_container ( container_id ) ] line [ 4 ] = self . localrepo . get_size ( container_id ) if print_size else "" Msg ( ) . out ( fmt % tuple ( line ) ) return self . STATUS_OK