-
Notifications
You must be signed in to change notification settings - Fork 75
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
Preserve relative urls in catalog references #35
Conversation
It should be possible to connect to a catalog reference using the base catalog's URL and the reference's href
The leading '/' in reference URLs is needed in order to properly construct the full URL from a relative URL
In principle I have no problem with this, but I see @lesserwhirls is responsible for the lines in question, so I'd like a second from him. Thanks for the contribution and tests! |
First off, I echo @dopplershift - thank you @ScottWales for the contribution and tests! It's a minor change, and I don't see anything wrong there. At some point soon, however, we should probably look at the module We can accept this as is as far as I am concerned just to get it working now. That said - @ScottWales, are you feeling frisky, because you could try to use Python 2:
Python 3:
Note that |
* Resolve relative hrefs to absolute URLs using urllib * Add CatalogRef.follow() to get a TDSCatalog from a CatalogRef
Happy to help. I've modified the pull request so that I've also added the |
That's great @ScottWales - thank you! |
Preserve relative urls in catalog references address part one of #20
The leading '/' in catalog references is needed to construct the full URL path from a catalog reference.
For instance, in the catalog
http://thredds-test.unidata.ucar.edu/thredds/testDatasets.xml
the referenceTestFmrc
points to/thredds/catalog/fmrc/ecmwf/global_2p5/catalog.xml
. Resolving the relative URL should givehttp://thredds-test.unidata.ucar.edu/thredds/catalog/fmrc/ecmwf/global_2p5/catalog.xml
. Removing the/
, as is being done inCatalogRef.__init__()
, means the URL is constructed relative to the current catalog path, rather than being relative to the hostname.