Skip to content

Commit f56a0ee

Browse files
committed
Bit of internal renaming
1 parent e07ba03 commit f56a0ee

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

neo4j/v1/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def on_failure(metadata):
221221
self.append(INIT, (user_agent,), response=response)
222222
self.send()
223223
while not response.complete:
224-
self.fetch_next()
224+
self.fetch()
225225

226226
def __del__(self):
227227
self.close()
@@ -255,9 +255,9 @@ def on_failure(metadata):
255255

256256
self.append(RESET, response=response)
257257
self.send()
258-
fetch_next = self.fetch_next
258+
fetch = self.fetch
259259
while not response.complete:
260-
fetch_next()
260+
fetch()
261261

262262
def send(self):
263263
""" Send all queued messages to the server.
@@ -268,7 +268,7 @@ def send(self):
268268
raise ProtocolError("Cannot write to a defunct connection")
269269
self.channel.send()
270270

271-
def fetch_next(self):
271+
def fetch(self):
272272
""" Receive exactly one message from the server.
273273
"""
274274
if self.closed:

neo4j/v1/session.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(self, connection, statement, parameters):
132132
self._keys = None
133133
self._connection = connection
134134
self._current = None
135-
self._next = deque()
135+
self._record_buffer = deque()
136136
self._position = -1
137137
self._summary = None
138138
self._consumed = False
@@ -154,15 +154,15 @@ def next(self):
154154
""" Advance to the next record, if available, and return a boolean
155155
to indicate whether or not the cursor has moved.
156156
"""
157-
if self._next:
158-
values = self._next.popleft()
157+
if self._record_buffer:
158+
values = self._record_buffer.popleft()
159159
self._current = Record(self.keys(), tuple(map(hydrated, values)))
160160
self._position += 1
161161
return True
162162
elif self._consumed:
163163
return False
164164
else:
165-
self._connection.fetch_next()
165+
self._connection.fetch()
166166
return self.next()
167167

168168
def record(self):
@@ -179,12 +179,12 @@ def at_end(self):
179179
""" Return ``True`` if at the end of the record stream, ``False``
180180
otherwise.
181181
"""
182-
if self._next:
182+
if self._record_buffer:
183183
return False
184184
elif self._consumed:
185185
return True
186186
else:
187-
self._connection.fetch_next()
187+
self._connection.fetch()
188188
return self.at_end()
189189

190190
def stream(self):
@@ -204,7 +204,7 @@ def keys(self):
204204
"""
205205
# Fetch messages until we have the header or a failure
206206
while self._keys is None and not self._consumed:
207-
self._connection.fetch_next()
207+
self._connection.fetch()
208208
return self._keys
209209

210210
def get(self, item, default=None):
@@ -226,17 +226,17 @@ def summarize(self):
226226

227227
def _consume(self):
228228
# Consume the remainder of this result, triggering all appropriate callback functions.
229-
fetch_next = self._connection.fetch_next
229+
fetch = self._connection.fetch
230230
while not self._consumed:
231-
fetch_next()
231+
fetch()
232232

233233
def _on_header(self, metadata):
234234
# Called on receipt of the result header.
235235
self._keys = metadata["fields"]
236236

237237
def _on_record(self, values):
238238
# Called on receipt of each result record.
239-
self._next.append(values)
239+
self._record_buffer.append(values)
240240

241241
def _on_footer(self, metadata):
242242
# Called on receipt of the result footer.

0 commit comments

Comments
 (0)