From commits-return-26258-archive-asf-public=cust-asf.ponee.io@tinkerpop.apache.org Wed Feb 14 21:34:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B29C61807BD for ; Wed, 14 Feb 2018 21:34:25 +0100 (CET) Received: (qmail 4863 invoked by uid 500); 14 Feb 2018 20:34:24 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 4746 invoked by uid 99); 14 Feb 2018 20:34:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Feb 2018 20:34:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C3504F2190; Wed, 14 Feb 2018 20:34:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: spmallette@apache.org To: commits@tinkerpop.apache.org Date: Wed, 14 Feb 2018 20:34:40 -0000 Message-Id: <44e71ad737294af8b1ccdb4b1422976e@git.apache.org> In-Reply-To: <69156fd69ba84acab7d80dc3279dbab5@git.apache.org> References: <69156fd69ba84acab7d80dc3279dbab5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu Dec 28 15:00:54 2017 -0500 Committer: Stephen Mallette 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) + ")"