Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Goblin OGM
AIO Gremlin
Commits
7d590e72
Unverified
Commit
7d590e72
authored
Dec 11, 2017
by
David Michael Brown
Committed by
GitHub
Dec 11, 2017
Browse files
Merge pull request #10 from jirikuncar/9-autodoc
docs: fixed missing references
parents
19845fad
6b9a904d
Changes
9
Hide whitespace changes
Inline
Side-by-side
aiogremlin/driver/client.py
View file @
7d590e72
...
...
@@ -8,11 +8,11 @@ from gremlin_python.process import traversal
class
Client
:
"""
Client that utilizes a :py:class:`Cluster<aiogremlin.cluster.Cluster>`
Client that utilizes a :py:class:`Cluster<aiogremlin.
driver.
cluster.Cluster>`
to access a cluster of Gremlin Server hosts. Issues requests to hosts using
a round robin strategy.
:param aiogremlin.cluster.Cluster cluster: Cluster used by
:param aiogremlin.
driver.
cluster.Cluster cluster: Cluster used by
client
:param asyncio.BaseEventLoop loop:
:param dict aliases: Optional mapping for aliases. Default is `None`
...
...
@@ -59,7 +59,7 @@ class Client:
**coroutine** Submit a script and bindings to the Gremlin Server.
:param message: Can be an instance of
`Message<gremlin_python.request.RequestMessage>` or
`
Request
Message<gremlin_python.
driver.
request.RequestMessage>` or
`Bytecode<gremlin_python.process.traversal.Bytecode>`
or a `str` representing a raw Gremlin script
:param dict bindings: Optional bindings used with raw Grelmin
...
...
aiogremlin/driver/connection.py
View file @
7d590e72
...
...
@@ -20,7 +20,7 @@ class Connection:
"""
Main classd for interacting with the Gremlin Server. Encapsulates a
websocket connection. Not instantiated directly. Instead use
:py:meth:`Connection.open<aiogremlin.connection.Connection.open>`.
:py:meth:
:
`Connection.open<aiogremlin.
driver.
connection.Connection.open>`.
:param str url: url for host Gremlin Server
:param gremlin_python.driver.transport.AbstractBaseTransport transport:
...
...
@@ -71,7 +71,7 @@ class Connection:
:param asyncio.BaseEventLoop loop:
:param gremlin_python.driver.protocol.AbstractBaseProtocol protocol:
Protocol implementation
:param
func
transport_factory: Factory function for transports
:param transport_factory: Factory function for transports
:param ssl.SSLContext ssl_context:
:param str username: Username for database auth
:param str password: Password for database auth
...
...
@@ -82,7 +82,7 @@ class Connection:
:param message_serializer: Message serializer implementation
:param provider: Graph provider object implementation
:returns: :py:class:`Connection<aiogremlin.connection.Connection>`
:returns: :py:class:`Connection<aiogremlin.
driver.
connection.Connection>`
"""
if
not
protocol
:
protocol
=
GremlinServerWSProtocol
(
message_serializer
)
...
...
aiogremlin/driver/pool.py
View file @
7d590e72
...
...
@@ -8,11 +8,11 @@ from aiogremlin.driver import connection
class
PooledConnection
:
"""
Wrapper for :py:class:`Connection<aiogremlin.connection.Connection>`
Wrapper for :py:class:`Connection<aiogremlin.
driver.
connection.Connection>`
that helps manage tomfoolery associated with connection pooling.
:param aiogremlin.connection.Connection conn:
:param aiogremlin.pool.ConnectionPool pool:
:param aiogremlin.
driver.
connection.Connection conn:
:param aiogremlin.
driver.
pool.ConnectionPool pool:
"""
def
__init__
(
self
,
conn
,
pool
):
self
.
_conn
=
conn
...
...
@@ -45,7 +45,7 @@ class PooledConnection:
:param args: Keyword arguments for Gremlin Server. Depend on processor
and op.
:returns: :py:class:`Response` object
:returns: :py:class:`
aiohttp.Client
Response` object
"""
return
await
self
.
_conn
.
write
(
message
)
...
...
aiogremlin/driver/server.py
View file @
7d590e72
...
...
@@ -45,7 +45,7 @@ class GremlinServer:
"""
Readonly property.
:returns: :py:class:`ConnectionPool<
gob
lin.driver.pool.ConnectionPool>`
:returns: :py:class:`ConnectionPool<
aiogrem
lin.driver.pool.ConnectionPool>`
"""
if
self
.
_pool
:
return
self
.
_pool
...
...
aiogremlin/process/graph_traversal.py
View file @
7d590e72
...
...
@@ -22,18 +22,21 @@ class AsyncGraphTraversal(graph_traversal.GraphTraversal):
return
object
async
def
toList
(
self
):
"""Reture results as ``list``."""
results
=
[]
async
for
result
in
self
:
results
.
append
(
result
)
return
results
async
def
toSet
(
self
):
"""Return results as ``set``."""
results
=
set
()
async
for
result
in
self
:
results
.
add
(
result
)
return
results
async
def
iterate
(
self
):
"""Iterate over results."""
while
True
:
try
:
await
self
.
nextTraverser
()
...
...
@@ -41,6 +44,7 @@ class AsyncGraphTraversal(graph_traversal.GraphTraversal):
return
self
async
def
nextTraverser
(
self
):
"""Return next traverser."""
if
self
.
traversers
is
None
:
await
self
.
traversal_strategies
.
apply_strategies
(
self
)
if
self
.
last_traverser
is
None
:
...
...
@@ -51,6 +55,7 @@ class AsyncGraphTraversal(graph_traversal.GraphTraversal):
return
temp
async
def
next
(
self
,
amount
=
None
):
"""Return iterator with optionaly defined amount of items."""
if
not
amount
:
try
:
return
await
self
.
__anext__
()
...
...
docs/aiogremlin.driver.rst
View file @
7d590e72
...
...
@@ -30,6 +30,8 @@ aiogremlin\.driver\.cluster module
aiogremlin\.driver\.connection module
-------------------------------------
.. autoclass:: gremlin_python.driver.protocol.AbstractBaseProtocol
.. automodule:: aiogremlin.driver.connection
:members:
:undoc-members:
...
...
docs/conf.py
View file @
7d590e72
...
...
@@ -152,7 +152,7 @@ html_theme_path = [alabaster.get_path()]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path
=
[
'_static'
]
#
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
...
...
docs/modules.rst
View file @
7d590e72
...
...
@@ -5,3 +5,26 @@ aiogremlin API
:maxdepth: 4
aiogremlin
External References
-------------------
.. autoclass:: gremlin_python.driver.transport.AbstractBaseTransport
.. autoclass:: gremlin_python.driver.remote_connection.RemoteStrategy
.. autoclass:: gremlin_python.driver.request.RequestMessage
.. autoclass:: gremlin_python.process.graph_traversal.GraphTraversal
.. autoclass:: gremlin_python.process.graph_traversal.GraphTraversalSource
.. autoclass:: gremlin_python.process.traversal.Bytecode
.. autoclass:: gremlin_python.process.traversal.Traversal
.. autoclass:: gremlin_python.process.traversal.TraversalSideEffects
.. autoclass:: gremlin_python.process.traversal.TraversalStrategies
.. autoclass:: gremlin_python.structure.graph.Graph
docs/usage.rst
View file @
7d590e72
...
...
@@ -37,8 +37,10 @@ by PEP 492::
>>> async for vertex in g.V():
... print(vertex)
Furthermore, it implements several convience methods - :py:meth:`toList`,
:py:meth:`toSet`, and :py:meth:`next`::
Furthermore, it implements several convience methods -
:py:meth:`toList<aiogremlin.process.graph_traversal.AsyncGraphTraversal.toList>`,
:py:meth:`toSet<aiogremlin.process.graph_traversal.AsyncGraphTraversal.toSet>`,
and :py:meth:`next<aiogremlin.process.graph_traversal.AsyncGraphTraversal.next>`::
>>> vertex_list = await g.V().toList()
>>> vertex_set = await g.V().toSet()
...
...
@@ -138,7 +140,7 @@ async interator protocol::
... print(v)
It also provides a convenience method
:py:meth:`all<aiogremlin.driver.
client.Clien
t.all>`
:py:meth:`all<aiogremlin.driver.
resultset.ResultSe
t.all>`
that aggregates and returns the result of the script in a :py:class:`list`::
>>> results = await result_set.all()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment