示例#1
0
def size_nlink_str(node):
    from acdcli.utils.progress import file_size_str

    if node.is_file():
        return nor_fmt % file_size_str(node.size).rjust(7)
    elif node.is_folder():
        return nor_fmt % str(node.size).rjust(7)
    return ''
示例#2
0
文件: format.py 项目: crza/acd_cli
def size_nlink_str(node):
    """Creates a right-justified nlinks string with width of 7 characters."""
    from acdcli.utils.progress import file_size_str

    if node.is_file():
        return nor_fmt % file_size_str(node.size).rjust(7)
    elif node.is_folder():
        return nor_fmt % str(node.nlinks).rjust(7)
    return ''
示例#3
0
def size_nlink_str(node):
    """Creates a right-justified nlinks string with width of 7 characters."""
    from acdcli.utils.progress import file_size_str

    if node.is_file():
        return nor_fmt % file_size_str(node.size).rjust(7)
    elif node.is_folder():
        return nor_fmt % str(node.nlinks).rjust(7)
    return ''
示例#4
0
    def size_nlink_str(self, node, size_bytes=False):
        """Creates a right-justified size/nlinks string."""
        from acdcli.utils.progress import file_size_str

        if node.is_file:
            if not size_bytes:
                return nor_fmt % file_size_str(node.size).rjust(7)
            return nor_fmt % str(node.size).rjust(11)
        elif node.is_folder:
            return nor_fmt % str(self.num_children(node.id)).rjust(7 if not size_bytes else 11)
        return ""
示例#5
0
def size_nlink_str(node, size_bytes=False):
    """Creates a right-justified size/nlinks string."""
    from acdcli.utils.progress import file_size_str

    if node.is_file():
        if not size_bytes:
            return nor_fmt % file_size_str(node.size).rjust(7)
        return nor_fmt % str(node.size).rjust(11)
    elif node.is_folder():
        return nor_fmt % str(node.nlinks).rjust(7 if not size_bytes else 11)
    return ''
示例#6
0
文件: format.py 项目: nferch/acd_cli
def size_nlink_str(node, size_bytes=False):
    """Creates a right-justified nlinks string."""
    from acdcli.utils.progress import file_size_str

    if node.is_file():
        return (
            nor_fmt % file_size_str(node.size).rjust(7) if not size_bytes
            else nor_fmt % str(node.size).rjust(11))
    elif node.is_folder():
        return nor_fmt % str(node.nlinks).rjust(7)
    return ''