You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/07/15 19:18:20 UTC
tinkerpop git commit: RawExpression no longer exists. register a
serializer with graphson Python.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1278 b2aed2422 -> 9a11864aa
RawExpression no longer exists. register a serializer with graphson Python.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9a11864a
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9a11864a
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9a11864a
Branch: refs/heads/TINKERPOP-1278
Commit: 9a11864aa2ba1fa1a4f99771649aee4accadc6b1
Parents: b2aed24
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Jul 15 13:18:16 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Jul 15 13:18:16 2016 -0600
----------------------------------------------------------------------
.../python/GraphTraversalSourceGenerator.groovy | 7 -
.../python/TraversalSourceGenerator.groovy | 21 --
.../gremlin_python/process/graph_traversal.py | 225 -------------------
.../jython/gremlin_python/process/traversal.py | 19 --
4 files changed, 272 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a11864a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/GraphTraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/GraphTraversalSourceGenerator.groovy b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/GraphTraversalSourceGenerator.groovy
index 8bb7988..0992beb 100644
--- a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/GraphTraversalSourceGenerator.groovy
+++ b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/GraphTraversalSourceGenerator.groovy
@@ -56,7 +56,6 @@ specific language governing permissions and limitations
under the License.
'''
""")
- pythonClass.append("from traversal import RawExpression\n")
pythonClass.append("from traversal import Traversal\n")
pythonClass.append("from traversal import Bytecode\n")
pythonClass.append("from gremlin_python import statics\n\n")
@@ -95,8 +94,6 @@ under the License.
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return traversal
""")
} else if (TraversalSource.isAssignableFrom(returnType)) {
@@ -107,8 +104,6 @@ under the License.
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
""")
}
@@ -140,8 +135,6 @@ under the License.
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
""")
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a11864a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
index c765936..64fe074 100644
--- a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
+++ b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
@@ -174,27 +174,6 @@ class Traversal(object):
pythonClass.append("\n")
//////////////
- pythonClass.append("""class RawExpression(object):
- def __init__(self, *args):
- self.bindings = dict()
- self.parts = [self._process_arg(arg) for arg in args]
-
- def _process_arg(self, arg):
- if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
- self.bindings[arg[0]] = arg[1]
- return Raw(arg[0])
- else:
- return Raw(arg)
-
-class Raw(object):
- def __init__(self, value):
- self.value = value
-
- def __str__(self):
- return str(self.value)
-
-""")
-
pythonClass.append("""
'''
TRAVERSER
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a11864a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
index 33f20fe..5c6be95 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
@@ -16,7 +16,6 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
'''
-from traversal import RawExpression
from traversal import Traversal
from traversal import Bytecode
from gremlin_python import statics
@@ -36,8 +35,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return traversal
def V(self, *args):
traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -45,8 +42,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return traversal
def addV(self, *args):
traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -54,8 +49,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return traversal
def inject(self, *args):
traversal = GraphTraversal(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -63,8 +56,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return traversal
def withBulk(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -72,8 +63,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withComputer(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -81,8 +70,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withPath(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -90,8 +77,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withSack(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -99,8 +84,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withSideEffect(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -108,8 +91,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withStrategies(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -117,8 +98,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withTranslator(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -126,8 +105,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
def withoutStrategies(self, *args):
source = GraphTraversalSource(self.graph, self.traversal_strategies, Bytecode(self.bytecode))
@@ -135,8 +112,6 @@ class GraphTraversalSource(object):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return source
@@ -148,800 +123,600 @@ class GraphTraversal(Traversal):
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _and(self, *args):
self.bytecode.add_step("_and", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _as(self, *args):
self.bytecode.add_step("_as", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _from(self, *args):
self.bytecode.add_step("_from", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _in(self, *args):
self.bytecode.add_step("_in", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _is(self, *args):
self.bytecode.add_step("_is", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _not(self, *args):
self.bytecode.add_step("_not", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def _or(self, *args):
self.bytecode.add_step("_or", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def addE(self, *args):
self.bytecode.add_step("addE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def addInE(self, *args):
self.bytecode.add_step("addInE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def addOutE(self, *args):
self.bytecode.add_step("addOutE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def addV(self, *args):
self.bytecode.add_step("addV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def aggregate(self, *args):
self.bytecode.add_step("aggregate", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def asAdmin(self, *args):
self.bytecode.add_step("asAdmin", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def barrier(self, *args):
self.bytecode.add_step("barrier", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def both(self, *args):
self.bytecode.add_step("both", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def bothE(self, *args):
self.bytecode.add_step("bothE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def bothV(self, *args):
self.bytecode.add_step("bothV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def branch(self, *args):
self.bytecode.add_step("branch", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def by(self, *args):
self.bytecode.add_step("by", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def cap(self, *args):
self.bytecode.add_step("cap", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def choose(self, *args):
self.bytecode.add_step("choose", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def coalesce(self, *args):
self.bytecode.add_step("coalesce", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def coin(self, *args):
self.bytecode.add_step("coin", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def constant(self, *args):
self.bytecode.add_step("constant", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def count(self, *args):
self.bytecode.add_step("count", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def cyclicPath(self, *args):
self.bytecode.add_step("cyclicPath", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def dedup(self, *args):
self.bytecode.add_step("dedup", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def drop(self, *args):
self.bytecode.add_step("drop", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def emit(self, *args):
self.bytecode.add_step("emit", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def filter(self, *args):
self.bytecode.add_step("filter", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def flatMap(self, *args):
self.bytecode.add_step("flatMap", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def fold(self, *args):
self.bytecode.add_step("fold", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def group(self, *args):
self.bytecode.add_step("group", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def groupCount(self, *args):
self.bytecode.add_step("groupCount", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def groupV3d0(self, *args):
self.bytecode.add_step("groupV3d0", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def has(self, *args):
self.bytecode.add_step("has", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def hasId(self, *args):
self.bytecode.add_step("hasId", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def hasKey(self, *args):
self.bytecode.add_step("hasKey", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def hasLabel(self, *args):
self.bytecode.add_step("hasLabel", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def hasNot(self, *args):
self.bytecode.add_step("hasNot", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def hasValue(self, *args):
self.bytecode.add_step("hasValue", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def id(self, *args):
self.bytecode.add_step("id", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def identity(self, *args):
self.bytecode.add_step("identity", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def inE(self, *args):
self.bytecode.add_step("inE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def inV(self, *args):
self.bytecode.add_step("inV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def inject(self, *args):
self.bytecode.add_step("inject", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def iterate(self, *args):
self.bytecode.add_step("iterate", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def key(self, *args):
self.bytecode.add_step("key", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def label(self, *args):
self.bytecode.add_step("label", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def limit(self, *args):
self.bytecode.add_step("limit", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def local(self, *args):
self.bytecode.add_step("local", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def loops(self, *args):
self.bytecode.add_step("loops", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def map(self, *args):
self.bytecode.add_step("map", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def mapKeys(self, *args):
self.bytecode.add_step("mapKeys", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def mapValues(self, *args):
self.bytecode.add_step("mapValues", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def match(self, *args):
self.bytecode.add_step("match", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def max(self, *args):
self.bytecode.add_step("max", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def mean(self, *args):
self.bytecode.add_step("mean", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def min(self, *args):
self.bytecode.add_step("min", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def option(self, *args):
self.bytecode.add_step("option", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def optional(self, *args):
self.bytecode.add_step("optional", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def order(self, *args):
self.bytecode.add_step("order", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def otherV(self, *args):
self.bytecode.add_step("otherV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def out(self, *args):
self.bytecode.add_step("out", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def outE(self, *args):
self.bytecode.add_step("outE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def outV(self, *args):
self.bytecode.add_step("outV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def pageRank(self, *args):
self.bytecode.add_step("pageRank", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def path(self, *args):
self.bytecode.add_step("path", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def peerPressure(self, *args):
self.bytecode.add_step("peerPressure", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def profile(self, *args):
self.bytecode.add_step("profile", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def program(self, *args):
self.bytecode.add_step("program", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def project(self, *args):
self.bytecode.add_step("project", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def properties(self, *args):
self.bytecode.add_step("properties", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def property(self, *args):
self.bytecode.add_step("property", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def propertyMap(self, *args):
self.bytecode.add_step("propertyMap", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def range(self, *args):
self.bytecode.add_step("range", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def repeat(self, *args):
self.bytecode.add_step("repeat", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def sack(self, *args):
self.bytecode.add_step("sack", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def sample(self, *args):
self.bytecode.add_step("sample", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def select(self, *args):
self.bytecode.add_step("select", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def sideEffect(self, *args):
self.bytecode.add_step("sideEffect", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def simplePath(self, *args):
self.bytecode.add_step("simplePath", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def store(self, *args):
self.bytecode.add_step("store", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def subgraph(self, *args):
self.bytecode.add_step("subgraph", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def sum(self, *args):
self.bytecode.add_step("sum", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def tail(self, *args):
self.bytecode.add_step("tail", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def timeLimit(self, *args):
self.bytecode.add_step("timeLimit", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def times(self, *args):
self.bytecode.add_step("times", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def to(self, *args):
self.bytecode.add_step("to", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def toE(self, *args):
self.bytecode.add_step("toE", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def toV(self, *args):
self.bytecode.add_step("toV", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def tree(self, *args):
self.bytecode.add_step("tree", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def unfold(self, *args):
self.bytecode.add_step("unfold", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def union(self, *args):
self.bytecode.add_step("union", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def until(self, *args):
self.bytecode.add_step("until", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def value(self, *args):
self.bytecode.add_step("value", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def valueMap(self, *args):
self.bytecode.add_step("valueMap", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def values(self, *args):
self.bytecode.add_step("values", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
def where(self, *args):
self.bytecode.add_step("where", *args)
for arg in args:
if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
self.bindings[arg[0]] = arg[1]
- elif isinstance(arg, RawExpression):
- self.bindings.update(arg.bindings)
return self
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a11864a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
index 32b13bc..9e56272 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
@@ -254,25 +254,6 @@ def without(*args):
statics.add_static('without',without)
-class RawExpression(object):
- def __init__(self, *args):
- self.bindings = dict()
- self.parts = [self._process_arg(arg) for arg in args]
-
- def _process_arg(self, arg):
- if isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
- self.bindings[arg[0]] = arg[1]
- return Raw(arg[0])
- else:
- return Raw(arg)
-
-class Raw(object):
- def __init__(self, value):
- self.value = value
-
- def __str__(self):
- return str(self.value)
-
'''
TRAVERSER