bartvm/blocks — pull request #73 by janchorowski (2014-12-19 18:34:49+00:00)
Title: New selector interface

Hi,

this is my first shot at a more feature-full selector interface. It is not meant to be merged, but please comment.

It supports pretty much everything I could think of:
`/` to go down one level
`//` to go down zero or more levels
`name` to match against names
`[regexp]` to regexp match against names
`@attribute==value` to check object attributes (to e.g. select bricks that have biases, that were initialized etc.)
`.container` to select stuff from the container (to select e.g. parameter)

The `selection` is always a `set` of selected objects or a `dict` mapping paths to selected objects. The `Selectors` take a selection and enumerate selected items.

Usage examples are in the tests. the syntax is slightly changed wrt Dima's selectors, but this is much more flexible. In fact, I only assume that things have a `children` attribute and a `name` attribute.

I think it is an important part to get right, so feel free to comment