Skip to content

Commit 340b0ed

Browse files
committed
Merge branch '1.7' of github.com:neo4j/neo4j-python-driver into 1.7
2 parents 3c10af9 + 6cd9ed7 commit 340b0ed

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
neobolt<2,>=1.7
2-
neotime<2,>=1.7
2+
neotime<2,>=1.7.1

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
from neo4j.meta import package, version
3131

3232
install_requires = [
33-
"neobolt==1.7.0rc5",
34-
"neotime",
33+
"neobolt<2,>=1.7",
34+
"neotime<2,>=1.7.1",
3535
]
3636
classifiers = [
3737
"Intended Audience :: Developers",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
3+
4+
# Copyright (c) 2002-2018 "Neo4j,"
5+
# Neo4j Sweden AB [http://neo4j.com]
6+
#
7+
# This file is part of Neo4j.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
21+
22+
# tag::custom-resolver-import[]
23+
from neo4j import GraphDatabase
24+
# end::custom-resolver-import[]
25+
26+
27+
# tag::custom-resolver[]
28+
29+
class CustomResolverExample:
30+
31+
def __init__(self, uri, user, password):
32+
self._driver = GraphDatabase.driver(uri, auth=(user, password), resolver=self.resolve)
33+
34+
def resolve(self, address):
35+
host, port = address
36+
if host == "x.example.com":
37+
yield "a.example.com", port
38+
yield "b.example.com", port
39+
yield "c.example.com", port
40+
else:
41+
yield host, port
42+
43+
def close(self):
44+
self._driver.close()
45+
46+
# end::custom-resolver[]

0 commit comments

Comments
 (0)