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 default filename for download #224

Closed
dopplershift opened this issue Apr 19, 2018 · 1 comment
Closed

Add default filename for download #224

dopplershift opened this issue Apr 19, 2018 · 1 comment
Labels
Area: Catalog good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Enhancement
Milestone

Comments

@dopplershift
Copy link
Member

Right now, Dataset.download() requires a filename to be passed in. We should make that optional, defaulting to the value of Dataset.name. So download should look roughly like

    def download(self, filename=None):
        if filename is None:
            filename = self.name
        with self.remote_open() as infile:
            with open(filename, 'wb') as outfile:
                outfile.write(infile.read())

with of course an updated docstring.

@dopplershift dopplershift added this to the 0.8 milestone Apr 19, 2018
@dopplershift dopplershift added Type: Enhancement Area: Catalog good first issue Straightforward issues suitable for new and inexperienced contributors to the project labels Apr 19, 2018
@dopplershift
Copy link
Member Author

Closed by #232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Catalog good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Enhancement
Projects
None yet
Development

No branches or pull requests

1 participant