Total Complexity | 4 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from aiogremlin.process import graph_traversal |
||
2 | from aiogremlin.process.traversal import AsyncTraversalStrategies |
||
3 | |||
4 | from gremlin_python.structure import graph |
||
5 | |||
6 | |||
7 | class Graph(graph.Graph): |
||
8 | |||
9 | def __init__(self): |
||
10 | if self.__class__ not in AsyncTraversalStrategies.global_cache: |
||
11 | AsyncTraversalStrategies.global_cache[ |
||
12 | self.__class__] = AsyncTraversalStrategies() |
||
13 | |||
14 | def traversal(self, traversal_source_class=None): |
||
15 | if not traversal_source_class: |
||
16 | traversal_source_class = graph_traversal.AsyncGraphTraversalSource |
||
17 | return traversal_source_class( |
||
18 | self, AsyncTraversalStrategies.global_cache[self.__class__]) |
||
19 |