Skip to content

Commit

Permalink
app_python3: give scan format to PyArg_ParseTuple() via param
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 27, 2018
1 parent 89c65fa commit 22749d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/app_python3/apy_kemi.c
Expand Up @@ -746,7 +746,7 @@ PyObject *sr_apy_kemi_return_none_mode(int rmode)
*
*/
static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject *args,
int rmode)
char *pfmt, int rmode)
{
str pvn;
pv_spec_t *pvs;
Expand All @@ -767,7 +767,7 @@ static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject *args,
lmsg = env_P->msg;
}

if(!PyArg_ParseTuple(args, "s:pv.get", &pvn.s)) {
if(!PyArg_ParseTuple(args, pfmt, &pvn.s)) {
LM_ERR("unable to retrieve str param\n");
return sr_apy_kemi_return_none_mode(rmode);
}
Expand Down Expand Up @@ -809,23 +809,23 @@ static PyObject *sr_apy_kemi_f_pv_get_mode(PyObject *self, PyObject *args,
*/
static PyObject *sr_apy_kemi_f_pv_get(PyObject *self, PyObject *args)
{
return sr_apy_kemi_f_pv_get_mode(self, args, 0);
return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.get", 0);
}

/**
*
*/
static PyObject *sr_apy_kemi_f_pv_getw(PyObject *self, PyObject *args)
{
return sr_apy_kemi_f_pv_get_mode(self, args, 1);
return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.getw", 1);
}

/**
*
*/
static PyObject *sr_apy_kemi_f_pv_gete(PyObject *self, PyObject *args)
{
return sr_apy_kemi_f_pv_get_mode(self, args, 2);
return sr_apy_kemi_f_pv_get_mode(self, args, "s:pv.gete", 2);
}

/**
Expand Down

0 comments on commit 22749d3

Please sign in to comment.