Kitware / tangelo

A simple, quick, powerful web framework
http:/tangelohub.org/tangelo/
Apache License 2.0
185 stars 35 forks source link

Import from source directory if in service area. #522

Closed manthey closed 8 years ago

manthey commented 8 years ago

If a service script tries to import and the import fails, it tries again within the same directory as the script. Note that this means that built-in and installed libraries get precedence over user scripts with the same name.

This eliminates the need to ever call tangelo.paths('.'), but other paths can still be usefully added.

Add tests for importing locally and from tangelo.paths().

The paths computed in tangelo.paths are now more thread-safe and won't accrete if the same path is added multiple times. There was a bug that if Tangelo were serving path foo/bar, then you could add a path foo/barbaz which wasn't in the served path.

This addresses issue #514.

waxlamp commented 8 years ago

I love the tests.

@manthey: this LGTM, besides the (very minor) typos, and the question of Python style.