-
Notifications
You must be signed in to change notification settings - Fork 42
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 string-or-file option. #400
Conversation
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 this very much!
Idea for the future: Do we need an almighty callback class, that can naturally chain multiple transformers, validators and presenters together?
json_option is now built on top of this. closes pulp#220.
8b4dd1c
to
70ee583
Compare
I have a vague image in my head of something like that, but nothing concrete enough to act on. As an example, I'm working on pulp_rpm things that would benefit from, say, a schema-check for json or xml. I'm def a big fan of keeping validation as close to the user as possible - anything we catch before a rest-call gets made is faster and puts less weight on the pulp instance. Def something to think about in our (copious) spare time :) |
try: | ||
with click.open_file(json_file, "rb") as fp: | ||
json_string = fp.read() | ||
with click.open_file(the_file, "r") as fp: |
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.
Ha, I guess that makes thinking about bytes
obsolete. Let's trust our tests, that we cover all use cases here.
json_option is now built on top of this.
closes #220.