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/01 15:30:55 UTC

[44/50] [abbrv] 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/aaf0b328
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/aaf0b328
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/aaf0b328

Branch: refs/heads/TINKERPOP-1857
Commit: aaf0b328cd75042e204b779502468d0eaf4cf7ab
Parents: 56afbf0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 15:00:54 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Feb 1 08:14:57 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/aaf0b328/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/aaf0b328/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) + ")"