-
Notifications
You must be signed in to change notification settings - Fork 17
add support for file_bytes argument with managed_file_context() #16
base: main
Are you sure you want to change the base?
Conversation
b605099 to
3a86892
Compare
70af652 to
e445899
Compare
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.
Some of my thoughts:
- Adding the extra variable
file_bytesfeels for me more like an extra type forfilepath. - In
__init__there are two places where we raise anInvalidArguments filepathisn't used beyondopen(self.filepath, "rb"), so why do we need a name attribute forfile_bytes?- The naming of
managed_file_contextisn't directly clear to me,open()would, or even implementPDFHandleras contextmanager so we can dowith selfbut I think with self.open() would be better - Is
@contextmanagerdoing the cleanup magically or do we need to do that manually?
|
Hi, Is this something that's planned to be merged soon? We're trying to move away from the old camelot and to this repo but this one is what's holding us back. Thanks. |
|
I'm currently not working on this one. |
8f7f5ab to
bd01e8e
Compare
|
@foarsitter Thanks for your review.
Do you have an suggestion to refactor this code?
Idk, I would assume that file_bytes has its own attribute, because it needs to be handled differently.
Yes, I think it is done automagically. AFAIK thats the purpose for the wrapper. Or should there be a: |
bd01e8e to
bdc2ae7
Compare
This is an attempt to cherry-pick in the PR from #15.
Fixes: camelot-dev#170 and camelot-dev#245 and atlanhq/camelot#376
and atlanhq/camelot#331
Was really fighting with git and the merge commits on the fork of a fork and so on...
Cherry pick approach was the cleanest.
I hope to have solved the merge conflicts correctly.
Please review..