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/12/05 19:27:39 UTC

[1/4] tinkerpop git commit: Fix calling of non-existing methods

Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 53e932b48 -> 054b6f099


Fix calling of non-existing methods


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

Branch: refs/heads/tp32
Commit: b4c42e91f8eacbfccae05786d6ebe096a1bc0a68
Parents: 53e932b
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Wed Nov 30 21:08:05 2016 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Fri Dec 2 17:02:35 2016 +0100

----------------------------------------------------------------------
 .../gremlin/python/GraphTraversalSourceGenerator.groovy  |  3 ++-
 .../jython/gremlin_python/process/graph_traversal.py     | 11 -----------
 2 files changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4c42e91/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 0d36581..1ffe575 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
@@ -159,6 +159,7 @@ under the License.
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
+                findAll { !it.name.equals("__") && !it.name.equals("start") }.
                 collect { SymbolHelper.toPython(it.name) }.
                 unique().
                 sort { a, b -> a <=> b }.
@@ -174,7 +175,7 @@ under the License.
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
-                findAll { !it.name.equals("__") }.
+                findAll { !it.name.equals("__") && !it.name.equals("start") }.
                 collect { SymbolHelper.toPython(it.name) }.
                 unique().
                 sort { a, b -> a <=> b }.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4c42e91/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 ceb4cb4..3c1a65d 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
@@ -395,9 +395,6 @@ class __(object):
   def V(*args):
     return GraphTraversal(None, None, Bytecode()).V(*args)
   @staticmethod
-  def __(*args):
-    return GraphTraversal(None, None, Bytecode()).__(*args)
-  @staticmethod
   def addE(*args):
     return GraphTraversal(None, None, Bytecode()).addE(*args)
   @staticmethod
@@ -617,9 +614,6 @@ class __(object):
   def simplePath(*args):
     return GraphTraversal(None, None, Bytecode()).simplePath(*args)
   @staticmethod
-  def start(*args):
-    return GraphTraversal(None, None, Bytecode()).start(*args)
-  @staticmethod
   def store(*args):
     return GraphTraversal(None, None, Bytecode()).store(*args)
   @staticmethod
@@ -1042,11 +1036,6 @@ def simplePath(*args):
 
 statics.add_static('simplePath', simplePath)
 
-def start(*args):
-      return __.start(*args)
-
-statics.add_static('start', start)
-
 def store(*args):
       return __.store(*args)
 


[2/4] tinkerpop git commit: Add implementations for __.__() and __.start()

Posted by ok...@apache.org.
Add implementations for __.__() and __.start()


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

Branch: refs/heads/tp32
Commit: da760378f81587e332241ebe07b60eaa42bbdcdb
Parents: b4c42e9
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Thu Dec 1 21:00:58 2016 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Fri Dec 2 17:09:35 2016 +0100

----------------------------------------------------------------------
 .../python/GraphTraversalSourceGenerator.groovy        | 12 ++++++++++--
 .../jython/gremlin_python/process/graph_traversal.py   | 11 +++++++++++
 .../src/main/jython/tests/process/test_traversal.py    | 13 +++++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da760378/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 1ffe575..9ba823c 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
@@ -155,7 +155,15 @@ under the License.
 ////////////////////////
 // AnonymousTraversal //
 ////////////////////////
-        pythonClass.append("class __(object):\n");
+        pythonClass.append(
+                """class __(object):
+  @staticmethod
+  def start():
+    return GraphTraversal(None, None, Bytecode())
+  @staticmethod
+  def __(*args):
+    return __.inject(*args)
+""")
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
@@ -175,7 +183,7 @@ under the License.
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
-                findAll { !it.name.equals("__") && !it.name.equals("start") }.
+                findAll { !it.name.equals("__") }.
                 collect { SymbolHelper.toPython(it.name) }.
                 unique().
                 sort { a, b -> a <=> b }.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da760378/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 3c1a65d..4f9017c 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
@@ -392,6 +392,12 @@ class GraphTraversal(Traversal):
 
 class __(object):
   @staticmethod
+  def start():
+    return GraphTraversal(None, None, Bytecode())
+  @staticmethod
+  def __(*args):
+    return __.inject(*args)
+  @staticmethod
   def V(*args):
     return GraphTraversal(None, None, Bytecode()).V(*args)
   @staticmethod
@@ -1036,6 +1042,11 @@ def simplePath(*args):
 
 statics.add_static('simplePath', simplePath)
 
+def start(*args):
+      return __.start(*args)
+
+statics.add_static('start', start)
+
 def store(*args):
       return __.store(*args)
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da760378/gremlin-python/src/main/jython/tests/process/test_traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/process/test_traversal.py b/gremlin-python/src/main/jython/tests/process/test_traversal.py
index e68b1e2..eb652f4 100644
--- a/gremlin-python/src/main/jython/tests/process/test_traversal.py
+++ b/gremlin-python/src/main/jython/tests/process/test_traversal.py
@@ -73,6 +73,19 @@ class TestTraversal(TestCase):
         assert "and(or(lt(b),gt(c)),or(neq(d),gte(e)))" == str(
             P.lt("b").or_(P.gt("c")).and_(P.neq("d").or_(P.gte("e"))))
 
+    def test_anonymous_traversal(self):
+        bytecode = __.__(1).bytecode
+        assert 0 == len(bytecode.bindings.keys())
+        assert 0 == len(bytecode.source_instructions)
+        assert 1 == len(bytecode.step_instructions)
+        assert "inject" == bytecode.step_instructions[0][0]
+        assert 1 == bytecode.step_instructions[0][1]
+        ##
+        bytecode = __.start().bytecode
+        assert 0 == len(bytecode.bindings.keys())
+        assert 0 == len(bytecode.source_instructions)
+        assert 0 == len(bytecode.step_instructions)
+
 
 if __name__ == '__main__':
     unittest.main()


[4/4] tinkerpop git commit: updated CHANGELOG.

Posted by ok...@apache.org.
updated CHANGELOG.


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

Branch: refs/heads/tp32
Commit: 054b6f0992afc3867179c495db3a48835c6b059f
Parents: 1a00f38
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Dec 5 12:27:31 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Dec 5 12:27:31 2016 -0700

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/054b6f09/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ebcc318..c7841a4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Fixed a bug in Gremlin-Python around `__.__()` and `__.start()`.
 * Fixed a bug around long serialization in Gremlin-Python when using Python3.
 * Deprecated `TraversalSource.withBindings()` as it is no longer needed in Gremlin-Java and never was needed for other variants.
 * Fixed a bug in Gremlin-Java `Bytecode` where anonymous traversals were not aware of parent bindings.


[3/4] tinkerpop git commit: Exclude start() from the static methods

Posted by ok...@apache.org.
Exclude start() from the static methods


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

Branch: refs/heads/tp32
Commit: 1a00f3805561a5d863fda41a7074b2bdac0f68ab
Parents: da76037
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Thu Dec 1 21:21:08 2016 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Fri Dec 2 17:09:35 2016 +0100

----------------------------------------------------------------------
 .../gremlin/python/GraphTraversalSourceGenerator.groovy         | 2 +-
 .../src/main/jython/gremlin_python/process/graph_traversal.py   | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a00f380/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 9ba823c..1c66c35 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
@@ -183,7 +183,7 @@ under the License.
         __.class.getMethods().
                 findAll { GraphTraversal.class.equals(it.returnType) }.
                 findAll { Modifier.isStatic(it.getModifiers()) }.
-                findAll { !it.name.equals("__") }.
+                findAll { !it.name.equals("__") && !it.name.equals("start") }.
                 collect { SymbolHelper.toPython(it.name) }.
                 unique().
                 sort { a, b -> a <=> b }.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a00f380/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 4f9017c..e722215 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
@@ -1042,11 +1042,6 @@ def simplePath(*args):
 
 statics.add_static('simplePath', simplePath)
 
-def start(*args):
-      return __.start(*args)
-
-statics.add_static('start', start)
-
 def store(*args):
       return __.store(*args)