diff --git a/README.md b/README.md index eef05b14cff37f1140610484688a180b9655364a..3f8eb840c426f81c6762f74b5dc4e199f05de059 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [aiogremlin 0.0.12](https://pypi.python.org/pypi/aiogremlin/0.0.11) +# [aiogremlin 0.1.0](https://pypi.python.org/pypi/aiogremlin/0.0.11) ## [Official Documentation](http://aiogremlin.readthedocs.org/en/latest/) diff --git a/aiogremlin/__init__.py b/aiogremlin/__init__.py index 22112762e00d6b0a063e7b720fd22d64373f15cf..a6ee6d4a1ecfc2129083298c22219675a4f6219b 100644 --- a/aiogremlin/__init__.py +++ b/aiogremlin/__init__.py @@ -4,4 +4,4 @@ from .exceptions import * from .connector import * from .subprotocol import * -__version__ = "0.0.12" +__version__ = "0.1.0" diff --git a/aiogremlin/client.py b/aiogremlin/client.py index 09340be2c8bce014215b8cb869b01f461f13e638..c93c06f8708b353b3a3daf1aa06fa413b0abc585 100644 --- a/aiogremlin/client.py +++ b/aiogremlin/client.py @@ -161,6 +161,8 @@ class GremlinClient: :param dict bindings: A mapping of bindings for Gremlin script. :param str lang: Language of scripts submitted to the server. "gremlin-groovy" by default + :param dict rebindings: Rebind ``Graph`` and ``TraversalSource`` + objects to different variable names in the current request :param str op: Gremlin Server op argument. "eval" by default. :param str processor: Gremlin Server processor argument. "" by default. :param float timeout: timeout for establishing connection (optional). @@ -329,6 +331,7 @@ def submit(gremlin, *, url='ws://localhost:8182/', bindings=None, lang="gremlin-groovy", + rebindings=None, op="eval", processor="", timeout=None, @@ -345,6 +348,8 @@ def submit(gremlin, *, :param dict bindings: A mapping of bindings for Gremlin script. :param str lang: Language of scripts submitted to the server. "gremlin-groovy" by default + :param dict rebindings: Rebind ``Graph`` and ``TraversalSource`` + objects to different variable names in the current request :param str op: Gremlin Server op argument. "eval" by default. :param str processor: Gremlin Server processor argument. "" by default. :param float timeout: timeout for establishing connection (optional). @@ -370,8 +375,8 @@ def submit(gremlin, *, try: resp = yield from gremlin_client.submit( - gremlin, bindings=bindings, lang=lang, op=op, processor=processor, - session=session, timeout=timeout) + gremlin, bindings=bindings, lang=lang, rebindings=rebindings, + op=op, processor=processor, session=session, timeout=timeout) return resp diff --git a/docs/conf.py b/docs/conf.py index 62727651c5b03551d252988a79879f7280b2dfc7..07f95313a137f50be8049f5f52e3f5887cc040ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,9 +62,9 @@ author = 'David M. Brown' # built documents. # # The short X.Y version. -version = '0.0.11' +version = '0.1.0' # The full version, including alpha/beta/rc tags. -release = '0.0.11' +release = '0.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index e04b14060f797d4256d7dc9410d94ed1c311c713..7087afd6c34a5109ed13e6f5788ada9ac5863910 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,7 +12,7 @@ based on the `asyncio`_ and `aiohttp`_ libraries. Releases ======== -The latest release of :py:mod:`aiogremlin` is **0.0.12**. +The latest release of :py:mod:`aiogremlin` is **0.1.0**. Requirements diff --git a/setup.py b/setup.py index 4ef8c5a13767458001961a393e0d671996ba7da2..57496da39ab1fa20f3e649c1ca8eb555b7e585ba 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name="aiogremlin", - version="0.0.12", + version="0.1.0", url="", license="MIT", author="davebshow", diff --git a/tests/tests.py b/tests/tests.py index ef2102e067aa83d4a7c78204c08c9d04cfe5262e..45c9a2f28dcfc8fc5437ebee3414372ef742cf5d 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -30,6 +30,25 @@ class SubmitTest(unittest.TestCase): results = self.loop.run_until_complete(go()) self.assertEqual(results[0].data[0], 8) + def test_rebinding(self): + execute = submit("graph2.addVertex()", loop=self.loop) + try: + self.loop.run_until_complete(execute.get()) + error = False + except: + error = True + self.assertTrue(error) + + @asyncio.coroutine + def go(): + result = yield from submit( + "graph2.addVertex()", rebindings={"graph2": "graph"}, + loop=self.loop) + resp = yield from result.get() + self.assertEqual(len(resp), 1) + + self.loop.run_until_complete(go()) + class GremlinClientTest(unittest.TestCase):