hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Unzipping creates redundant folders #63

Open Castronova opened 7 years ago

Castronova commented 7 years ago

When the restclient unzips a resource, a duplicate folder is created. This doesn't happen when resources are downloaded directly from HydroShare and unzipped manually.

>>> import hs_restclient
>>> hs = hs_restclient.hydroshare()
>>> hs.getResource('da7973a47a0849798be5ae5a1110c1c0', unzip=True, destination='.')

creates the following folder structure

$ tree da7973a47a0849798be5ae5a1110c1c0/
da7973a47a0849798be5ae5a1110c1c0/
└── da7973a47a0849798be5ae5a1110c1c0
    ├── bagit.txt
    ├── data
    │   ├── contents
    │   │   └── vegetation.zip
    │   ├── resourcemap.xml
    │   └── resourcemetadata.xml
    ├── manifest-md5.txt
    ├── readme.txt
    └── tagmanifest-md5.txt

instead is should simply be

$ tree da7973a47a0849798be5ae5a1110c1c0/
da7973a47a0849798be5ae5a1110c1c0/
├── bagit.txt
├── data
│   ├── contents
│   │   └── vegetation.zip
│   ├── resourcemap.xml
│   └── resourcemetadata.xml
├── manifest-md5.txt
├── readme.txt
└── tagmanifest-md5.txt
aphelionz commented 5 years ago

Hey @Castronova would you mind un-assigning me from the hs_restclient tickets?