csonpath 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {csonpath-0.3.0/csonpath.egg-info → csonpath-0.4.0}/PKG-INFO +1 -1
- {csonpath-0.3.0 → csonpath-0.4.0/csonpath.egg-info}/PKG-INFO +1 -1
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath.h +2 -2
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath_python.c +7 -3
- {csonpath-0.3.0 → csonpath-0.4.0}/pyproject.toml +2 -2
- {csonpath-0.3.0 → csonpath-0.4.0}/LICENSE +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/MANIFEST.in +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/README.md +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath.egg-info/SOURCES.txt +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath.egg-info/dependency_links.txt +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath.egg-info/requires.txt +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath.egg-info/top_level.txt +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/csonpath_do.h +0 -0
- {csonpath-0.3.0 → csonpath-0.4.0}/setup.cfg +0 -0
|
@@ -723,7 +723,7 @@ again:
|
|
|
723
723
|
int nb_res = 0;
|
|
724
724
|
|
|
725
725
|
#define CSONPATH_DO_RET_TYPE int
|
|
726
|
-
#define CSONPATH_DO_FUNC_NAME
|
|
726
|
+
#define CSONPATH_DO_FUNC_NAME update_or_create
|
|
727
727
|
|
|
728
728
|
/*
|
|
729
729
|
* assuming tmp == value can only be true,
|
|
@@ -813,7 +813,7 @@ again:
|
|
|
813
813
|
int nb_res = 0;
|
|
814
814
|
|
|
815
815
|
#define CSONPATH_DO_RET_TYPE int
|
|
816
|
-
#define CSONPATH_DO_FUNC_NAME
|
|
816
|
+
#define CSONPATH_DO_FUNC_NAME update_or_create_callback
|
|
817
817
|
#define CSONPATH_DO_RETURN \
|
|
818
818
|
if (tmp == value) { \
|
|
819
819
|
*need_reloop = 1; \
|
|
@@ -78,7 +78,11 @@ static int python_set_or_insert_item(PyObject *array, Py_ssize_t at, PyObject *
|
|
|
78
78
|
PyErr_Format(PyExc_ValueError, "Unable to follow path: List expected");
|
|
79
79
|
return -1;
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
size_t s = PyList_Size(array);
|
|
82
|
+
if (at >= s) {
|
|
83
|
+
for (;s < at; ++s)
|
|
84
|
+
PyList_Insert(array, s, Py_None);
|
|
85
|
+
|
|
82
86
|
PyList_Insert(array, at, el);
|
|
83
87
|
} else {
|
|
84
88
|
Py_INCREF(el);
|
|
@@ -234,7 +238,7 @@ static PyObject *update_or_create(PyCsonPathObject *self, PyObject* args)
|
|
|
234
238
|
|
|
235
239
|
if (!PyArg_ParseTuple(args, "OO", &json, &value))
|
|
236
240
|
BAD_ARG();
|
|
237
|
-
int ret =
|
|
241
|
+
int ret = csonpath_update_or_create(self->cp, json, value);
|
|
238
242
|
if (ret < 0)
|
|
239
243
|
return NULL;
|
|
240
244
|
return PyLong_FromLong(ret);
|
|
@@ -246,7 +250,7 @@ static PyObject *update_or_create_callback(PyCsonPathObject *self, PyObject* arg
|
|
|
246
250
|
|
|
247
251
|
if (!PyArg_ParseTuple(args, "OO|O", &json, &callback, &udata))
|
|
248
252
|
BAD_ARG();
|
|
249
|
-
int ret =
|
|
253
|
+
int ret = csonpath_update_or_create_callback(self->cp, json, callback, udata);
|
|
250
254
|
return PyLong_FromLong(ret);
|
|
251
255
|
}
|
|
252
256
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "csonpath"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
|
|
10
10
|
[tool.setuptools]
|
|
@@ -22,7 +22,7 @@ dev = [
|
|
|
22
22
|
testpaths = ["tests/python"]
|
|
23
23
|
|
|
24
24
|
[tool.bumpversion]
|
|
25
|
-
current_version = "0.
|
|
25
|
+
current_version = "0.4.0"
|
|
26
26
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
27
27
|
serialize = ["{major}.{minor}.{patch}"]
|
|
28
28
|
search = "{current_version}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|