-
-
Notifications
You must be signed in to change notification settings - Fork 39
Add new method to ArchiveWrite- add_entry_from_memory #38
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 new method to ArchiveWrite- add_entry_from_memory #38
Conversation
@@ -73,6 +74,39 @@ def add_files(self, *paths): | |||
write_finish_entry(write_p) | |||
entry_clear(entry_p) | |||
|
|||
def add_entry_from_memory(self, entry): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an entry object instead of passing directly the 3 arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like more consistency of one object with arguments than 3 arguments but I'm open to discussion and I can change that if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change it. It's inconsistent and confusing, because the type of entry
is ArchiveEntry
elsewhere in the code, but here it's a "virtual" Entry
type that the library doesn't provide (in the test you create it with namedtuple
). That would probably be okay in JavaScript code, but this is Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: #26 is a related issue. |
Fixing pep8 Adding whitespace
Conflicts: libarchive/ffi.py libarchive/write.py Fixing another pep8
A few more tweaks and this should be ready for merge. |
@@ -22,7 +22,6 @@ | |||
logger = logging.getLogger('libarchive') | |||
|
|||
page_size = mmap.PAGESIZE | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove that unnecessary whitespace change.
…names; adding additional arguments to add_file_from_memory Removing whitespace change
… add_file_from_memory
Thanks @krzysztofzuraw, good work. :-) |
Add new method to ArchiveWrite- add_entry_from_memory
Add new method
add_entry_from_memory
for creating archive from files stored in memory.