testutil.py 455 Bytes
Newer Older
1 2
# -----------------------------------------------------------------------------
# Utils
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
def version_to_ints(v):
    return [ int(x) for x in v.split('.') ]

def version_lt(x, y):
    return version_to_ints(x) < version_to_ints(y)

def version_le(x, y):
    return version_to_ints(x) <= version_to_ints(y)

def version_gt(x, y):
    return version_to_ints(x) > version_to_ints(y)

def version_ge(x, y):
    return version_to_ints(x) >= version_to_ints(y)