Пример #1
0
static PyObject* pyWAVHeader_read(pyWAVHeader* self, PyObject* args) {
    pyStream* stream;
    if (!PyArg_ParseTuple(args, "O", &stream)) {
        PyErr_SetString(PyExc_TypeError, "read expects a hsStream");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream)) {
        PyErr_SetString(PyExc_TypeError, "read expects a hsStream");
        return NULL;
    }
    self->fThis->read(stream->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #2
0
static PyObject* pyPageInfo_writeSums(pyPageInfo* self, PyObject* args) {
    pyStream* stream;
    if (!PyArg_ParseTuple(args, "O", &stream)) {
        PyErr_SetString(PyExc_TypeError, "writeSums expects an hsStream");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream)) {
        PyErr_SetString(PyExc_TypeError, "writeSums expects an hsStream");
        return NULL;
    }
    self->fThis->writeSums(stream->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject* pyGUICtrlProcWriteableObject_Write(PyObject*, PyObject* args) {
    pyStream* stream;
    pyGUICtrlProcWriteableObject* proc;
    if (!PyArg_ParseTuple(args, "OO", &stream, &proc)) {
        PyErr_SetString(PyExc_TypeError, "Write expects hsStream, pfGUICtrlProcWriteableObject");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyGUICtrlProcWriteableObject_Check((PyObject*)proc)) {
        PyErr_SetString(PyExc_TypeError, "Write expects hsStream, pfGUICtrlProcWriteableObject");
        return NULL;
    }
    pfGUICtrlProcWriteableObject::Write(stream->fThis, proc->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #4
0
static PyObject* pyDebug_Init(PyObject*, PyObject* args) {
    int level = plDebug::kDLWarning;
    pyStream* stream = NULL;
    if (!PyArg_ParseTuple(args, "|iO", &level, &stream)) {
        PyErr_SetString(PyExc_TypeError, "Init expects int, hsStream");
        return NULL;
    }
    if (stream != NULL && !pyStream_Check((PyObject*)stream)) {
        PyErr_SetString(PyExc_TypeError, "Init expects int, hsStream");
        return NULL;
    }
    plDebug::Init(level, (stream == NULL) ? NULL : stream->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #5
0
static PyObject* pyEventData_write(pyEventData* self, PyObject* args) {
    pyStream* stream;
    pyResManager* mgr;
    if (!PyArg_ParseTuple(args, "OO", &stream, &mgr)) {
        PyErr_SetString(PyExc_TypeError, "write expects hsStream, plResManager");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyResManager_Check((PyObject*)mgr)) {
        PyErr_SetString(PyExc_TypeError, "write expects hsStream, plResManager");
        return NULL;
    }
    self->fThis->write(stream->fThis, mgr->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #6
0
static PyObject* pyResManager_writeKey(pyResManager* self, PyObject* args) {
    pyStream* stream;
    pyKey* key;
    if (!PyArg_ParseTuple(args, "OO", &stream, &key)) {
        PyErr_SetString(PyExc_TypeError, "writeKey expects hsStream, plKey");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyKey_Check((PyObject*)key)) {
        PyErr_SetString(PyExc_TypeError, "writeKey expects hsStream, plKey");
        return NULL;
    }
    self->fThis->writeKey(stream->fThis, *(key->fThis));
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #7
0
static PyObject* pyResManager_WriteCreatable(pyResManager* self, PyObject* args) {
    pyStream* stream;
    pyCreatable* cre;
    if (!PyArg_ParseTuple(args, "OO", &stream, &cre)) {
        PyErr_SetString(PyExc_TypeError, "WriteCreatable expects hsStream, plCreatable");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyCreatable_Check((PyObject*)cre)) {
        PyErr_SetString(PyExc_TypeError, "WriteCreatable expects hsStream, plCreatable");
        return NULL;
    }
    self->fThis->WriteCreatable(stream->fThis, cre->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #8
0
static PyObject* pyCluster_read(pyCluster* self, PyObject* args) {
    pyStream* stream;
    pyClusterGroup* group;
    if (!PyArg_ParseTuple(args, "OO", &stream, &group)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, plClusterGroup");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyClusterGroup_Check((PyObject*)group)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, plClusterGroup");
        return NULL;
    }
    self->fThis->read(stream->fThis, group->fThis);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #9
0
static PyObject* pyKeyFrame_read(pyKeyFrame* self, PyObject* args) {
    pyStream* stream;
    int type;
    if (!PyArg_ParseTuple(args, "Oi", &stream, &type)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, int");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, int");
        return NULL;
    }
    self->fThis->read(stream->fThis, type);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #10
0
static PyObject* pySpanInstance_read(pySpanInstance* self, PyObject* args) {
    pyStream* stream;
    pySpanEncoding* encoding;
    int numVerts;
    if (!PyArg_ParseTuple(args, "OOi", &stream, &encoding, &numVerts)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, plSpanEncoding, int");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pySpanEncoding_Check((PyObject*)encoding)) {
        PyErr_SetString(PyExc_TypeError, "read expects hsStream, plSpanEncoding, int");
        return NULL;
    }
    self->fThis->read(stream->fThis, *encoding->fThis, numVerts);
    Py_INCREF(Py_None);
    return Py_None;
}
Пример #11
0
static PyObject* pyEventData_Read(PyObject*, PyObject* args) {
    pyStream* stream;
    pyResManager* mgr;
    if (!PyArg_ParseTuple(args, "OO", &stream, &mgr)) {
        PyErr_SetString(PyExc_TypeError, "Read expects hsStream, plResManager");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)stream) || !pyResManager_Check((PyObject*)mgr)) {
        PyErr_SetString(PyExc_TypeError, "Read expects hsStream, plResManager");
        return NULL;
    }
    proEventData* evt = proEventData::Read(stream->fThis, mgr->fThis);
    PyObject* pyEvt = pyEventData_FromEventData(evt);
    ((pyEventData*)pyEvt)->fPyOwned = true;
    return pyEvt;
}
Пример #12
0
static PyObject* pyStream_writeFrom(pyStream* self, PyObject* args) {
    pyStream* from;
    if (!PyArg_ParseTuple(args, "O", &from)) {
        PyErr_SetString(PyExc_TypeError, "writeFrom expects a pyStream");
        return NULL;
    }
    if (!pyStream_Check((PyObject*)from)) {
        PyErr_SetString(PyExc_TypeError, "writeFrom expects a pyStream");
        return NULL;
    }
    try {
        self->fThis->writeFrom(from->fThis);
    } catch (...) {
        PyErr_SetString(PyExc_IOError, "Error copying stream");
        return NULL;
    }

    Py_INCREF(Py_None);
    return Py_None;
}