-
Notifications
You must be signed in to change notification settings - Fork 192
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
Templatereplacer parser make more general #5669
Conversation
Are you swearing in your commit messages? 😄 |
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 guess that we are technically breaking functionality here, given that this is a public plugin. Then again, I agree that having such a specific implementation that is just being used for a test-case that doubles a number, seems silly. I doubt that anyone out there is using this other than for testing (but still unlikely), in which case I think it is acceptable to break that. So I'd be ok with merging this. Just one change to address.
@@ -69,13 +69,13 @@ def parse(self, **kwargs): | |||
|
|||
@staticmethod | |||
def parse_stdout(filelike): | |||
"""Parse the sum from the output of the ArithmeticAddcalculation written to standard out. | |||
"""Parse the content from the output of the TemplatereplacerCalculation written to output file. |
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 that we no longer need the try/catch in this method. The ValueError
was being caught in case the output could not be cast to an integer. So really this method should just do return filelike.read()
but that is ridiculous, so might as well get rid of the method entirely and just change line 32 to
result = handle.read()
and be done with it.
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.
Good point. Changed.
@sphuber thanks a lot!
Haha, "f-me" for "Fix by myself", and "r-seb" for "Review and advised by Sebastiaan". Sorry for this, I know it is not a good habit to do such simple and ridiculous commit messages, but sometimes it is harder to write meaningful commit messages than fix bugs.
I guess you mean the parser? I actually use this |
No problem whatsoever, just found it funny because it looked like a "fuck me, again a small fix to make the pre-commit pass" or something like that 😄
Both, but mostly the parsers, as that was really specific to a code even that would just double an input. Clearly only useful for such a test case. |
It is a good explanation, I may keep on using it with this. 🤪 |
The
TemplatereplacerParser
is general enough which I am going to use for the nightly test of portable containerized code. here I clean up the outdated docstring and move it out fromdoubler
.