You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/02/14 20:34:40 UTC

[18/31] tinkerpop git commit: TINKERPOP-1857 Generation of P for python was incorrect

TINKERPOP-1857 Generation of P for python was incorrect

The template was generating not() bytecode with the python naming of not_(). There were also duplicate functions in the template that needed to be removed.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c06e8a26
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c06e8a26
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c06e8a26

Branch: refs/heads/TINKERPOP-1857
Commit: c06e8a26be0bcf9a9749a6f812a13f5840deb25c
Parents: e96a2a6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 15:00:54 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Feb 14 15:34:09 2018 -0500

----------------------------------------------------------------------
 gremlin-python/glv/TraversalSource.template           | 14 ++++----------
 .../main/jython/gremlin_python/process/traversal.py   | 14 ++++----------
 2 files changed, 8 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c06e8a26/gremlin-python/glv/TraversalSource.template
----------------------------------------------------------------------
diff --git a/gremlin-python/glv/TraversalSource.template b/gremlin-python/glv/TraversalSource.template
index 66ea940..b6f5b9f 100644
--- a/gremlin-python/glv/TraversalSource.template
+++ b/gremlin-python/glv/TraversalSource.template
@@ -112,26 +112,20 @@ class P(object):
         self.operator = operator
         self.value = value
         self.other = other
-
 <% pmethods.each { method -> %>
     @staticmethod
     def <%= method %>(*args):
-        return P("<%= toPython.call(method) %>", *args)
+        return P("<%= toJava.call(method) %>", *args)
 <% } %>
     def and_(self, arg):
         return P("and", self, arg)
+
     def or_(self, arg):
         return P("or", self, arg)
+
     def __eq__(self, other):
         return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
-    def __repr__(self):
-        return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
-    def and_(self, arg):
-        return P("and", self, arg)
-    def or_(self, arg):
-        return P("or", self, arg)
-    def __eq__(self, other):
-        return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
+
     def __repr__(self):
         return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
 <% pmethods.findAll{!it.equals("clone")}.each { method -> %>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c06e8a26/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 69275fb..747ed81 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
@@ -186,7 +186,6 @@ class P(object):
         self.value = value
         self.other = other
 
-
     @staticmethod
     def between(*args):
         return P("between", *args)
@@ -221,7 +220,7 @@ class P(object):
 
     @staticmethod
     def not_(*args):
-        return P("not_", *args)
+        return P("not", *args)
 
     @staticmethod
     def outside(*args):
@@ -241,18 +240,13 @@ class P(object):
 
     def and_(self, arg):
         return P("and", self, arg)
+
     def or_(self, arg):
         return P("or", self, arg)
+
     def __eq__(self, other):
         return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
-    def __repr__(self):
-        return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
-    def and_(self, arg):
-        return P("and", self, arg)
-    def or_(self, arg):
-        return P("or", self, arg)
-    def __eq__(self, other):
-        return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
+
     def __repr__(self):
         return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"