Esempio n. 1
0
    def close(self):
        """Close the HDF file.

        Args:
          no argument
        Returns:
          None

        C library equivalent : Hclose
                                                """

        _checkErr('close', _C.Hclose(self._id), "cannot close file")
        self._id = None
Esempio n. 2
0
    def close(self):
        """Close the HDF file.

        Args:
          no argument
        Returns:
          None

        C library equivalent : Hclose
                                                """

        _checkErr("close", _C.Hclose(self._id), "cannot close file")
        self._id = None
Esempio n. 3
0
def getlibversion():
    """Get the library version info.

    Args:
      no argument
    Returns:
      4-element tuple with the following components:
        -major version number (int)
        -minor version number (int)
        -complete library version number (int)
        -additional information (string)

    C library equivalent : Hgetlibversion
                                                   """

    status, major_v, minor_v, release, info = _C.Hgetlibversion()
    _checkErr('getlibversion', status, "cannot get lib version")
    return major_v, minor_v, release, info
Esempio n. 4
0
def getlibversion():
    """Get the library version info.

    Args:
      no argument
    Returns:
      4-element tuple with the following components:
        -major version number (int)
        -minor version number (int)
        -complete library version number (int)
        -additional information (string)

    C library equivalent : Hgetlibversion
                                                   """

    status, major_v, minor_v, release, info = _C.Hgetlibversion()
    _checkErr("getlibversion", status, "cannot get lib version")
    return major_v, minor_v, release, info
Esempio n. 5
0
            else:
                if HC.CREATE & mode:
                    mode = HC.CREATE
                else:
                    raise HDF4Error, "HDF: no such file"
        else:
            if exists:
                if mode & HC.READ:
                    mode = HC.READ  # clean mode
                else:
                    raise HDF4Error, "HDF: invalid mode"
            else:
                raise HDF4Error, "HDF: no such file"

        id = _C.Hopen(path, mode, nblocks)
        _checkErr('HDF', id, "cannot open %s" % path)
        self._id = id

    def __del__(self):
        """Delete the instance, first calling the end() method 
        if not already done.          """

        try:
            if self._id:
                self.close()
        except:
            pass

    def close(self):
        """Close the HDF file.
Esempio n. 6
0
            else:
                if HC.CREATE & mode:
                    mode = HC.CREATE
                else:
                    raise HDF4Error, "HDF: no such file"
        else:
            if exists:
                if mode & HC.READ:
                    mode = HC.READ  # clean mode
                else:
                    raise HDF4Error, "HDF: invalid mode"
            else:
                raise HDF4Error, "HDF: no such file"

        id = _C.Hopen(path, mode, nblocks)
        _checkErr("HDF", id, "cannot open %s" % path)
        self._id = id

    def __del__(self):
        """Delete the instance, first calling the end() method 
        if not already done.          """

        try:
            if self._id:
                self.close()
        except:
            pass

    def close(self):
        """Close the HDF file.