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

Provide sane defaults for file_writer #65

Open
leblancfg opened this issue Feb 23, 2018 · 1 comment
Open

Provide sane defaults for file_writer #65

leblancfg opened this issue Feb 23, 2018 · 1 comment

Comments

@leblancfg
Copy link

leblancfg commented Feb 23, 2018

It seems as though the line:

with libarchive.file_writer('test.tar.gz', 'ustar', 'gzip') as archive:

could be boiled down to:

with libarchive.file_writer('test.tar.gz') as archive:

as format_name and filter_name can be inferred by filepath's extension.


Currently, users have to:

  1. Dig through ffi.py source code to see the list of valid format_names and filter_names
    • Providing a docstring for file_writer would be invaluable here.
  2. Already know what types of formats to use for what filters.
    • I'm sure a list of sane default could be chosen for most formats, which could still be overwritten if specified in the function call.

I'm sure this is a jarring experience to most.

@pypingou
Copy link

pypingou commented Dec 5, 2018

Coming to this lib for the first time, I'll say +1 for this (outside of this feature more documentation would be great!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants