def parse_ranges(range_string):
    """Turn ranges (like you specify in a print dialog) into a list of inclusive bounds."""
    ret = []
    components = [rang.split('-') for rang in range_string.split(',')]
    for rang in components:
        if len(rang) == 1:
            ret.append((int(rang[0]), int(rang[0])))
        elif len(rang) == 2:
            ret.append((int(rang[0]), int(rang[1])))
        else:
            raise ValueError('invalid range specification')
    return ret