bulbs
bulbs copied to clipboard
Custom step
James,
this is the functionality I mentioned before.
This allows the usage of node.custom_step('friend')
or `node.custom_step('out.out').
I made a few changes, which I believe are rather independent from the implementation details of lower layers. I send them in different pull requests.
Thanks. I'll look at this more when I have some time...not sure I understand the use case here. You can already do a custom step (one that's not stored in a .groovy file) via:
>>> g.gremlin.query("g.v.(id).out.out", {id: 1})
I agree. This is a convenience feature. It comes especially handy in cases when you don't have direct access to "g". For example in the class definition of a model, where you now have to write something like
a=self._client.gremlin("g.v(id).out.out", {'id': self.eid})
b=initialize_elements(self._client,a)
Instead it is simpler to write
b=self.custom_step("out.out")
This and the other pull requests are some features which I use, so I thought I share them with you. I am happy if these (or some variations) become part of the main line (like #90), but is absolutely no problem for me if for any reason you have a different opinion.
A similar method existed in Bulbs 0.2 and I removed it to simply the code in Bulbs 0.3 when I reworked the Gremlin module:
https://github.com/espeed/bulbs/blob/0.2.x/bulbs/element.py#L143
Let's hold off on this for now -- I have an ideas for how to simply Gremlin calls from Models that may make this approach unnecessary .