New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive globbing #381

Merged
merged 6 commits into from Jun 29, 2014

Conversation

Projects
None yet
2 participants
@jabooth
Member

jabooth commented Jun 5, 2014

Solves #376.

The recursive glob operator '**' is now fully supported in Menpo.

images = list(menpo.io.import_images(./foo/**/something/*.jpg'))

will return

./foo/bar/something/x.jpg
./foo/bla/boo/something/y.jpg.
./foo/something/x.jpg

Few minor notes:

  1. mesh_paths and image_paths are now generators.
  2. We now have a dependency on pathlib, the Python 3+ core path library. We can now choose to start using path objects in place of strings throughout Menpo, but that is left for a later pull request.
  3. directories with no glob are now permitted as input - the '*' glob is automatically added. For recursive globbing, you have to be explicit:
# returns meshes immediately under the foo folder
import_meshes('.foo')

# returns meshes recursively under the foo folder
import_meshes('.foo/**/*')
@jabooth

This comment has been minimized.

Member

jabooth commented Jun 5, 2014

ahh yes, of course Travis will fail, he doesn't know of the new dependency. Not sure what's best to do here?

@jalabort

This comment has been minimized.

Member

jalabort commented Jun 25, 2014

This worked like a charm for me James! Nice work!

@jalabort

This comment has been minimized.

Member

jalabort commented Jun 25, 2014

+1

jabooth added a commit that referenced this pull request Jun 29, 2014

@jabooth jabooth merged commit 73ff8bc into menpo:master Jun 29, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details

@jabooth jabooth deleted the jabooth:pathlib branch Jun 29, 2014

@jabooth jabooth referenced this pull request Jun 29, 2014

Closed

pathlib conda dependency #385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment