def __prefixNumber(num, leading):
    """
    Prefixes "num" with %leading zeroes.
    """
    length = int(leading)+1
    num = str(num)
    while len(num) < length:
        num = '0' + num
    return num