Beispiel #1
0
def isis_version(isisroot):
    # Check if this is versioning the ISIS3.3.0 way
    if P.isfile(P.join(isisroot,'version')):
        f = open(P.join(isisroot,'version'),'r')
        version = f.readline().strip().split('.')
        return ".".join(version[0:3])
    header = P.join(isisroot, 'src/base/objs/Constants/Constants.h')
    m = grep('version\("(.*?)"', header)
    if not m:
        raise Exception('Unable to locate ISIS version header (expected at %s). Perhaps your ISISROOT (%s) is incorrect?' % (header, isisroot))
    return m[0].group(1)
Beispiel #2
0
def isis_version(isisroot):
    # Check if this is versioning the ISIS3.3.0 way
    if P.isfile(P.join(isisroot,'version')):
        f       = open(P.join(isisroot,'version'),'r')
        version = f.readline().strip().split('.')
        return ".".join(version[0:3])
    header = P.join(isisroot, 'src/base/objs/Constants/Constants.h')
    m      = grep('version\("(.*?)"', header)
    if not m:
        raise Exception('Unable to locate ISIS version header (expected at %s). Perhaps your ISISROOT (%s) is incorrect?' 
                        % (header, isisroot))
    return m[0].group(1)
Beispiel #3
0
def isis_version(isisroot):
    # Check the ISIS version
    if P.isfile(P.join(isisroot, 'version')):
        f = open(P.join(isisroot, 'version'), 'r')
        raw = f.readline().strip()
        version = raw.split('#')[0].strip().split(
            '.')  # Strip out comment first
        return ".".join(version[0:3])
    # TODO(oalexan1): The isis headers will move from here the miniconda dir at some point
    header = P.join(isisroot, 'include/isis/Constants.h')
    m = grep('version\("(.*?)"', header)
    if not m:
        raise Exception(
            'Unable to locate ISIS version header (expected at %s). Perhaps your ISISROOT (%s) is incorrect?'
            % (header, isisroot))
    return m[0].group(1)
Beispiel #4
0
def isis_version(isisroot):
    header = P.join(isisroot, 'src/base/objs/Constants/Constants.h')
    m = grep('version\("(.*?)"', header)
    if not m:
        raise Exception('Unable to locate ISIS version header (expected at %s). Perhaps your ISISROOT ($s) is incorrect?' % (header, isisroot))
    return m[0].group(1)