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

def nwsclient::NwsServer::listWss (   self,
  format = STRING 
)

Return a listing of all of the workspaces on the NWS server.

s.listWss([format]) -> string or dictionary

The listing is a string, consisting of lines, each ending with a
newline.  Each line consists of tab separated fields.  The first
field is the workspace name, prefixed with either a '>' or a
space, indicating whether the client owns that workspace or
not.

Definition at line 227 of file nwsclient.py.

00227                                     :
        """Return a listing of all of the workspaces on the NWS server.

        s.listWss([format]) -> string or dictionary

        The listing is a string, consisting of lines, each ending with a
        newline.  Each line consists of tab separated fields.  The first
        field is the workspace name, prefixed with either a '>' or a
        space, indicating whether the client owns that workspace or
        not.

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

        if format not in _formats:
            raise ValueError, 'illegal format: ' + format

        op = 'list wss'
        self._sendAll('0001%020d%s' % (len(op), op))
        status = self._recvN(4) # unused at the moment.
        desc = self._recvN(20) # unused at the moment.
        n = int(self._recvN(20))
        listing = self._recvN(n)

        if format == DICT:
            wss = {}
            if listing:
                for ws in listing[:-1].split('\n'):
                    wsRec = ws.split('\t')
                    mine = wsRec[0][0] == '>'
                    wsRec[WS_NAME] = wsRec[WS_NAME][1:]
                    wsRec.insert(WS_MINE, mine)
                    wsRec[WS_PERSISTENT] = wsRec[WS_PERSISTENT].lower().startswith('t')
                    wsRec[WS_NUMVARS] = int(wsRec[WS_NUMVARS])
                    wsRec[WS_VARLIST] = wsRec[WS_VARLIST] and wsRec[WS_VARLIST].split(',') or []
                    wss[wsRec[WS_NAME]] = tuple(wsRec)
        else:
            wss = listing

        return wss

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


Generated by  Doxygen 1.6.0   Back to index