def open(path, mode="r"):
        """
        Open a file.

        Returns an instance of the format handler. 

        path
          String path name.

        mode
          String mode. Since only mode='r' (read-only) is currently used, it is optional.
          """
        f = None

        if path[-3:] == ".nc":
            cd = CdunifFormatHandler.open(path, mode=mode)

            f = AcmeMultiFormatHandler(cd.file)
        else:
            f = AcmeMultiFormatHandler(None)
        return f
Ejemplo n.º 2
0
    def open(path, mode='r'):
        """
        Open a file.

        Returns an instance of the format handler. 

        path
          String path name.

        mode
          String mode. Since only mode='r' (read-only) is currently used, it is optional.
          """
        f = None
        
        if (path[-3:] == ".nc"):  
            cd = CdunifFormatHandler.open(path, mode=mode)

            f = AcmeMultiFormatHandler(cd.file)
        else:
            f = AcmeMultiFormatHandler(None)
        return f