def split_as_string(split_mask, width, symbol1=None, symbol2=None): "Returns a 'pretty' split representation." s = textutils.int_to_bitstring(split_mask).rjust(width, '0') if symbol1 is not None: s = s.replace('0', symbol1) if symbol2 is not None: s = s.replace('1', symbol2) return s
def split_bitmask_string(self, split_bitmask): "Returns bitstring representation of split_bitmask." return "%s" % textutils.int_to_bitstring(split_bitmask).rjust(len(self), "0")