def lsdir(qname='/', truncate=True):
    """Prints all directory entries below the given node.
    @param qname the directory node (must start with '/')
    """
    ds = container.directory
    delist = ds.find_child_entries(qname)
    detable = [(str(de._id), str(de.attributes)) for de in delist]

    if len(detable) == 0:
        print
        return
    if truncate:
        rows, columns = get_console_dimensions()
        col1wid = get_max_width(detable, 0)
        col1max = min(50 if columns > 50 else 0, col1wid)
        print pprint_table(detable, trunc=[-col1max, columns - col1max - 2 if columns > col1max + 3 else 0])
    else:
        print "\n".join(["%s: %s" % tup for tup in detable])
dataset/ETHPy150Open ooici/pyon/pyon/container/shell_api.py/lsdir/original