You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2017/09/12 14:59:02 UTC
[07/50] [abbrv] tinkerpop git commit: Adjust py dsl traversals in
docs to match patterns in test CTR
Adjust py dsl traversals in docs to match patterns in test CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/eb57077e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/eb57077e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/eb57077e
Branch: refs/heads/TINKERPOP-1752
Commit: eb57077eac68afdab9ac06962b68ceceada6bfc0
Parents: 7c954e9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 28 11:39:49 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 28 11:39:49 2017 -0400
----------------------------------------------------------------------
docs/src/reference/the-traversal.asciidoc | 21 +++++++++++---------
.../src/main/jython/tests/process/test_dsl.py | 6 ++----
2 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eb57077e/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 3e67a25..d4c9efa 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -3234,17 +3234,20 @@ class SocialTraversal(GraphTraversal):
return self.outE("created").count().is_(P.gte(number))
class __(AnonymousTraversal):
- @staticmethod
- def knows(*args):
- return SocialTraversal(None, None, Bytecode()).knows(*args)
- @staticmethod
- def youngestFriendsAge(*args):
- return SocialTraversal(None, None, Bytecode()).youngestFriendsAge(*args)
+ graph_traversal = SocialTraversal
- @staticmethod
- def createdAtLeast(*args):
- return SocialTraversal(None, None, Bytecode()).createdAtLeast(*args)
+ @classmethod
+ def knows(cls, *args):
+ return cls.graph_traversal(None, None, Bytecode()).knows(*args)
+
+ @classmethod
+ def youngestFriendsAge(cls, *args):
+ return cls.graph_traversal(None, None, Bytecode()).youngestFriendsAge(*args)
+
+ @classmethod
+ def createdAtLeast(cls, *args):
+ return cls.graph_traversal(None, None, Bytecode()).createdAtLeast(*args)
class SocialTraversalSource(GraphTraversalSource):
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eb57077e/gremlin-python/src/main/jython/tests/process/test_dsl.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/process/test_dsl.py b/gremlin-python/src/main/jython/tests/process/test_dsl.py
index 5ec79ca..7fe1ea4 100644
--- a/gremlin-python/src/main/jython/tests/process/test_dsl.py
+++ b/gremlin-python/src/main/jython/tests/process/test_dsl.py
@@ -62,12 +62,10 @@ class SocialTraversalSource(GraphTraversalSource):
self.graph_traversal = SocialTraversal
def persons(self, *args):
- traversal = self.get_graph_traversal()
- traversal.bytecode.add_step("V")
- traversal.bytecode.add_step("hasLabel", "person")
+ traversal = self.get_graph_traversal().V().hasLabel("person")
if len(args) > 0:
- traversal.bytecode.add_step("has", "name", P.within(args))
+ traversal = traversal.has("name", P.within(args))
return traversal