Logo Search packages:      
Sourcecode: r-cran-nws version File versions  Download package

def nwsclient::NwsServer::mktempWs (   self,
  wsName = '__pyws__%d' 
)

Make a temporary workspace on the NWS server.

s.mktempWs([wsName]) -> string

The workspace is named using the template and a number
generated by the server that makes the workspace name unique.

Note that the workspace will be created, but it will not be
owned until some client that is willing to take ownership of it
opens it.

The return value is the actual name of workspace that was
created.

Arguments:

wsName -- Template for the workspace name.  This must be a legal
'format' string, containing only an integer format
specifier.  The default is '__pyws__%d'.

Examples:

    Let's create an NwsServer, call mktempWs to make a
    workspace, and then use openWs to create a NetWorkSpace
    object for that workspace:

>>> from nws.client import NwsServer
>>> server = NwsServer()
>>> name = server.mktempWs('example_%d')
>>> workspace = server.openWs(name)

Definition at line 269 of file nwsclient.py.

00269                                            :
        """Make a temporary workspace on the NWS server.

        s.mktempWs([wsName]) -> string

        The workspace is named using the template and a number
        generated by the server that makes the workspace name unique.

        Note that the workspace will be created, but it will not be
        owned until some client that is willing to take ownership of it
        opens it.

        The return value is the actual name of workspace that was
        created.

        Arguments:

        wsName -- Template for the workspace name.  This must be a legal
                'format' string, containing only an integer format
                specifier.  The default is '__pyws__%d'.

        Examples:

            Let's create an NwsServer, call mktempWs to make a
            workspace, and then use openWs to create a NetWorkSpace
            object for that workspace:

                >>> from nws.client import NwsServer
                >>> server = NwsServer()
                >>> name = server.mktempWs('example_%d')
                >>> workspace = server.openWs(name)

        """
        if type(wsName) != str:
            raise TypeError, 'workspace name must be a string'

        op = 'mktemp ws'
        self._sendAll('0002%020d%s%020d%s' % (len(op), op, len(wsName), wsName))
        status = int(self._recvN(4))
        desc = self._recvN(20) # unused at the moment.
        name = self._recvN(int(self._recvN(20)))
        if status: raise NwsOperationException, 'mktempWs failed'
        return name

    def openWs(self, wsName, space=None, **opt):


Generated by  Doxygen 1.6.0   Back to index