Skip to content

Commit

Permalink
app_python: 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 22749d3 commit c1701cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/app_python/apy_kemi.c
Expand Up @@ -723,7 +723,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 @@ -744,7 +744,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 @@ -786,23 +786,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 c1701cf

Please sign in to comment.