Exemplo n.º 1
0
def getRunList(myrange):
    """
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8].
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError, ex:
        raise ConfigurationException("Invalid runRange: %s" % myrange)
Exemplo n.º 2
0
def getRunList(myrange):
    """
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8].
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError, ex:
        raise ConfigurationException("Invalid runRange: %s" % myrange)
Exemplo n.º 3
0
def _expandRange(myrange):
    """
    Used to expand the runRange parameter
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8]
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError, ex:
        raise ConfigurationException("Invalid runRange: %s" % myrange)
Exemplo n.º 4
0
def _expandRange(myrange):
    """
    Used to expand the runRange parameter
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8]
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError, ex:
        raise ConfigurationException("Invalid runRange: %s" % myrange)
Exemplo n.º 5
0
def getRunList(myrange):
    """
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8].
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError:
        raise ConfigurationException("Invalid runRange: %s" % myrange)

    myrange = myrange.split(',')
    result = []
    for element in myrange:
        if element.count('-') > 0:
            mySubRange = element.split('-')
            subInterval = range( int(mySubRange[0]), int(mySubRange[1])+1)
            result.extend(subInterval)
        else:
            result.append(int(element))

    return result
Exemplo n.º 6
0
def getRunList(myrange):
    """
    Take a string like '1,2,5-8' and return a list of integers [1,2,5,6,7,8].
    """
    myrange = myrange.replace(' ','')
    if not myrange:
        return []
    try:
        jobrange(myrange)
    except AssertionError as ex:
        raise ConfigurationException("Invalid runRange: %s" % myrange)

    myrange = myrange.split(',')
    result = []
    for element in myrange:
        if element.count('-') > 0:
            mySubRange = element.split('-')
            subInterval = range( int(mySubRange[0]), int(mySubRange[1])+1)
            result.extend(subInterval)
        else:
            result.append(int(element))

    return result