Exemplo n.º 1
0
def extract(src, dest):
    if '.zip' in src:
        return unzip(src, dest)
    if '.tar.gz' in src or '.tgz' in src:
        return untar(src, dest)
Exemplo n.º 2
0
def extract(src, dest):
    if ".zip" in src:
        return unzip(src, dest)
    if ".tar.gz" in src or ".tgz" in src:
        return untar(src, dest)
Exemplo n.º 3
0
            # untar
            fctar = pjoin(mysuite['tardir'],
                          mysuite['tgzname'].format(ymdh=ymdh))
            print 'Untarring ', fctar
            if not os.path.exists(fctar):
                print 'Not there', fctar
                continue

            gdir, fformat, ltmax = mysuite['dir'], mysuite['fformat'], mysuite[
                'ltmax']
            lastfile = pjoin(gdir,
                             fformat.format(ymdh=ymdh, lt=str(ltmax).zfill(3)))
            if not os.path.exists(lastfile):
                untar.untar(fctar,
                            mysuite['dir'],
                            pattern=mysuite['fformat'].format(ymdh=ymdh,
                                                              lt='*'),
                            tempdir=pjoin(mysuite['dir'], 'untar'))
            #sys.exit(0)

            # check if untarring went ok: otherwise skip to next
            if not os.path.exists(lastfile): continue

            # surface:
            inf = pjoin(gdir, fformat.format(ymdh=ymdh, lt='*'))
            outfile = pjoin(outdir, mysuite['shortname'],
                            'harm_REFO_{ymdh}.nc'.format(ymdh=ymdh))
            cmd = surf_cmd.format(tab=mysuite['tab'],
                                  outfile=outfile,
                                  inf=inf,
                                  levs=mysuite['nlevs'])
Exemplo n.º 4
0
def extract(src, dest):
    if ".zip" in src:
        return unzip(src, dest)
    if ".tar.gz" in src or ".tgz" in src:
        return untar(src, dest)
Exemplo n.º 5
0
# All modules that should be installed for the baltrad node
# Note, it is essential that the order is correct here since
# they will be installed in this order. There is no dependency
# checking for this.
#
# So, if for example HDF5 is dependent on ZLIB. ZLIB must be installed prior to
# HDF5. But since HDF5 is dependent on ZLIB, HDF5 must get the depends set to ZLIB
# so that HDF5 is rebuilt each time ZLIB is rebuilt.
##
MODULES = [
    prepareinstaller(package("PREPARE", "1.0", nodir(), remembered=False)),
    shinstaller(package("ZLIB", "1.2.11", nodir()), ":"),
    cmmi(
        package("HDF5",
                "1.10.1",
                untar(urlfetcher("hdf5-1.10.1.tar.gz"), "hdf5-1.10.1", True),
                depends=["ZLIB"]),
        "--prefix=\"$TPREFIX\" --with-pthread=yes --enable-threadsafe --enable-unsupported",
        False,
        True,  # unsupported for MT + HL library
        foptionalarg=hdf5_optional_zlib_arg),
    netcdfinstaller(
        package("NETCDF",
                "4.5.0",
                untar(urlfetcher("netcdf-c-4.5.0.tar.gz"), "netcdf-c-4.5.0",
                      True),
                depends=["ZLIB", "HDF5"])),
    cmmi(
        package("EXPAT", "2.0.1",
                untar(urlfetcher("expat-2.0.1.tar.gz"), "expat-2.0.1", True)),
        "--prefix=\"$TPREFIX\"", False, True),