Skip to content
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

Add support for passing local files to server as raw data #97

Merged
merged 8 commits into from
Jan 11, 2019
Merged

Conversation

huard
Copy link
Contributor

@huard huard commented Dec 19, 2018

Overview

This PR fixes #96

Changes:

  • Added support for path to local files ('/...' and 'file:///')
  • Added support for file-like object (BaseIO)
  • Added support for Path instances
  • If server is localhost and Path to file is local, send reference
  • Updated documentation and notebook

Test suite requires bird-house/emu#74

@cehbrecht cehbrecht added this to the 0.6.0 milestone Dec 19, 2018
Copy link
Member

@cehbrecht cehbrecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added comments to the code.

birdy/client/utils.py Outdated Show resolved Hide resolved
birdy/client/utils.py Outdated Show resolved Hide resolved
tests/test_client.py Show resolved Hide resolved
birdy/client/utils.py Outdated Show resolved Hide resolved
@huard
Copy link
Contributor Author

huard commented Dec 20, 2018

Does OWSLib know when to tag content with CDATA ? As long as we're passing trivial text and base64, we're good, but if not, that could become a problem.

@cehbrecht
Copy link
Member

owslib does not automatically use cdata encoding for complex inputs:
https://github.com/geopython/OWSLib/blob/dcbc8db9a8eafa715a0469317bf23ea07de17326/owslib/wps.py#L1619

We may prepare this in birdy. But probably we would like to move the encoding part to owslib (base64, raw, cdata, ...). The encoding is decided by the mime-type.

@cehbrecht
Copy link
Member

Just to reference comments in pywps PR:
geopython/pywps#444

@cehbrecht
Copy link
Member

... codacy complain belongs to this PR.

Unused urljoin imported from six.moves.urllib.parse

@cehbrecht
Copy link
Member

@huard fixed urljoin import and run successfully manual tests. Shall I merge?

@huard huard merged commit dc6d42f into master Jan 11, 2019
@huard huard deleted the fix_96 branch January 11, 2019 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support passing local files with the native python client
2 participants