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

def nwsclient::NetWorkSpace::store (   self,
  varName,
  val 
)

Store a new value into a variable in the workspace.

ws.store(varName, val)

Arguments:

varName -- Name of the variable.

val -- Value to store in the variable.

Definition at line 842 of file nwsclient.py.

00842                                  :
        """Store a new value into a variable in the workspace.

        ws.store(varName, val)

        Arguments:

        varName -- Name of the variable.

        val -- Value to store in the variable.

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

        op = 'store'

        desc = _PythonFP
        if StringType == type(val): desc |= _DirectString
        descTxt = '%020u' % desc

        if desc & _DirectString:
            pVal = val
        else:
            pVal = cPickle.dumps(val)

        self.send('0005%020d%s%020d%s%020d%s%020d%s%020d' % (len(op), op, len(self.curWs), self.curWs, len(varName), varName, len(descTxt), descTxt, len(pVal)))
        self.send(pVal)

        status = int(self.recv(4))
        if status: raise NwsOperationException, 'store failed'

    def __retrieveFile(self, varName, op, fobj):


Generated by  Doxygen 1.6.0   Back to index