-
Notifications
You must be signed in to change notification settings - Fork 15
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 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_bytes
feels for me more like an extra type forfilepath
. - In
__init__
there are two places where we raise anInvalidArguments
filepath
isn't used beyondopen(self.filepath, "rb")
, so why do we need a name attribute forfile_bytes
?- The naming of
managed_file_context
isn't directly clear to me,open()
would, or even implementPDFHandler
as contextmanager so we can dowith self
but I think with self.open() would be better - Is
@contextmanager
doing 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..