Skip to content

Commit 6742af6

Browse files
committed
chore: change istep to i
1 parent 00d5585 commit 6742af6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

jsonpath/__init__.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Author : zhangxianbing1
33
Date : 2020-12-27 09:22:14
44
LastEditors : zhangxianbing1
5-
LastEditTime : 2021-01-04 09:59:44
5+
LastEditTime : 2021-01-04 10:27:22
66
Description : JSONPath
77
"""
8-
__version__ = "1.0.0"
8+
__version__ = "0.0.2"
99
__author__ = "zhangxianbing"
1010

1111
import json
@@ -111,10 +111,6 @@ def _f_putback_quote(self, m):
111111
def _f_putback_bracket(self, m):
112112
return self.subx["#B"][int(m.group(1))]
113113

114-
@staticmethod
115-
def _f_notvar(m):
116-
return f"{m.group(1)} not in __obj"
117-
118114
@staticmethod
119115
def _f_brackets(m):
120116
ret = "__obj"
@@ -136,22 +132,22 @@ def parse(self, obj):
136132
return self.result
137133

138134
@staticmethod
139-
def _traverse(f, obj, istep: int, *args):
135+
def _traverse(f, obj, i: int, *args):
140136
if isinstance(obj, list):
141137
for v in obj:
142-
f(v, istep, *args)
138+
f(v, i, *args)
143139
elif isinstance(obj, dict):
144140
for v in obj.values():
145-
f(v, istep, *args)
141+
f(v, i, *args)
146142

147-
def _filter(self, obj, istep: int, step):
143+
def _filter(self, obj, i: int, step: str):
148144
r = False
149145
try:
150146
r = eval(step, None, {"__obj": obj})
151147
except Exception as err:
152148
print(err)
153149
if r:
154-
self._trace(obj, istep)
150+
self._trace(obj, i)
155151

156152
def _trace(self, obj, i: int):
157153
"""Perform operation on object.

0 commit comments

Comments
 (0)