This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea is to force each recipe to rely only on logic to post proceed the data.
Currently, these recipes were updated to fit the needs:
and these queries:
The update lies in rewriting recipe files to hold only logic about which queries to run and how to present output data.
For this reason, each query is now consisting of "query" and "argument_parser" fields. "query" contains information about the query and "argument_parser" is an yaml formatted string of
docopt help message.
Recipe holds information about all the processing requiring things. In order to allow to treat one list of input differently with recipe argument_parser logic and query argument_parser logic modified_docopt was created. It simply overrides main docopt in last 3 lines:
from:
to
This is done because if there are some arguments which can not be parsed (
left != []
) docopt exits. This update forces docopt to return everything that was matched since one argument list will be used to get data for both recipe and the query.As well, update provides support for not updated queries and recipes:
If no "argument_parser" field is loaded from query on
load_query
step, program treats recipe as not updated one.I just had this idea in my mind and wanted to share it :)
I will be very glad for any discussions and critics
Thanks for always being helpful :)