示例#1
0
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
示例#2
0
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
示例#3
0
 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")
示例#4
0
 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")