summaryrefslogtreecommitdiffstats
path: root/pcilib/py.c
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-12 17:50:57 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-12 17:50:57 +0100
commit1b3342649294c6ce99aeb82664a29eac47687ee5 (patch)
treefb34ee89e1edc4dd3e27c2a1416a435192c7ae6b /pcilib/py.c
parent55eab7196d0104c71e40136b3b22e9501d234e17 (diff)
downloadpcitool-1b3342649294c6ce99aeb82664a29eac47687ee5.tar.gz
pcitool-1b3342649294c6ce99aeb82664a29eac47687ee5.tar.bz2
pcitool-1b3342649294c6ce99aeb82664a29eac47687ee5.tar.xz
pcitool-1b3342649294c6ce99aeb82664a29eac47687ee5.zip
Move python module init code to transfom view constructor
Update python logger and python exeption messages Change serialization method in create_pcilib_instance set_pcilib functions
Diffstat (limited to 'pcilib/py.c')
-rw-r--r--pcilib/py.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pcilib/py.c b/pcilib/py.c
index 7b1ae79..e448d21 100644
--- a/pcilib/py.c
+++ b/pcilib/py.c
@@ -244,11 +244,11 @@ void* pcilib_get_value_as_pyobject(pcilib_t* ctx, pcilib_value_t *val)
switch(val->type)
{
case PCILIB_TYPE_INVALID:
- pcilib_error("Invalid register output type (PCILIB_TYPE_INVALID)");
+ pcilib_warning("Invalid register output type (PCILIB_TYPE_INVALID)");
return NULL;
case PCILIB_TYPE_STRING:
- pcilib_error("Invalid register output type (PCILIB_TYPE_STRING)");
+ pcilib_warning("Invalid register output type (PCILIB_TYPE_STRING)");
return NULL;
case PCILIB_TYPE_LONG:
@@ -258,7 +258,7 @@ void* pcilib_get_value_as_pyobject(pcilib_t* ctx, pcilib_value_t *val)
if(err)
{
- pcilib_error("Failed: pcilib_get_value_as_int (%i)", err);
+ pcilib_error("Failed: pcilib_get_value_as_int (%i)", err);
return NULL;
}
return (PyObject*)PyInt_FromLong((long) ret);
@@ -271,14 +271,14 @@ void* pcilib_get_value_as_pyobject(pcilib_t* ctx, pcilib_value_t *val)
if(err)
{
- pcilib_error("Failed: pcilib_get_value_as_int (%i)", err);
+ pcilib_error("Failed: pcilib_get_value_as_int (%i)", err);
return NULL;
}
return (PyObject*)PyFloat_FromDouble((double) ret);
}
default:
- pcilib_error("Invalid register output type (unknown)");
+ pcilib_warning("Invalid register output type (unknown)");
return NULL;
}
}
@@ -360,7 +360,7 @@ int pcilib_py_init_script(pcilib_t *ctx, char* module_name, pcilib_access_mode_t
//setting pcilib_t instance
PyObject_CallMethodObjArgs(pcipywrap_module,
PyUnicode_FromString("set_pcilib"),
- PyByteArray_FromStringAndSize((const char*)&ctx, sizeof(pcilib_t*)),
+ PyCObject_FromVoidPtr(ctx, NULL),
NULL);
}