def pformat(self):
        """ Pretty string format """
        lines = []
        lines.append(("%s (%s)" % (self.name, self.status)).center(50, "-"))
        lines.append("items: {0:,} ({1:,} bytes)".format(self.item_count, self.size))
        cap = self.consumed_capacity.get("__table__", {})
        read = "Read: " + format_throughput(self.read_throughput, cap.get("read"))
        write = "Write: " + format_throughput(self.write_throughput, cap.get("write"))
        lines.append(read + "  " + write)
        if self.decreases_today > 0:
            lines.append("decreases today: %d" % self.decreases_today)

        if self.range_key is None:
            lines.append(str(self.hash_key))
        else:
            lines.append("%s, %s" % (self.hash_key, self.range_key))

        for field in itervalues(self.attrs):
            if field.key_type == "INDEX":
                lines.append(str(field))

        for index_name, gindex in iteritems(self.global_indexes):
            cap = self.consumed_capacity.get(index_name)
            lines.append(gindex.pformat(cap))

        return "\n".join(lines)
def pformat ( self ) : lines = [ ] lines . append ( ( "%s (%s)" % ( self . name , self . status ) ) . center ( 50 , "-" ) ) lines . append ( "items: {0:,} ({1:,} bytes)" . format ( self . item_count , self . size ) ) cap = self . consumed_capacity . get ( "__table__" , { } ) read = "Read: " + format_throughput ( self . read_throughput , cap . get ( "read" ) ) write = "Write: " + format_throughput ( self . write_throughput , cap . get ( "write" ) ) lines . append ( read + "  " + write ) if self . decreases_today > 0 : lines . append ( "decreases today: %d" % self . decreases_today ) if self . range_key is None : lines . append ( str ( self . hash_key ) ) else : lines . append ( "%s, %s" % ( self . hash_key , self . range_key ) ) for field in itervalues ( self . attrs ) : if field . key_type == "INDEX" : lines . append ( str ( field ) ) for index_name , gindex in iteritems ( self . global_indexes ) : cap = self . consumed_capacity . get ( index_name ) lines . append ( gindex . pformat ( cap ) ) return "\n" . join ( lines )
Pretty string format