I have attempted to re-write the nodejs.prov python script to more idiomatic Python and to be more easily modified for downstream purposes (i.e. adapted for software collection purposes).
Since I suspect that maintainers of NodeJS-related software might not also be Pythonistas, I will gladly explain anything confusing in the code (in other words, please help me add comments where necessary 😉).
Notable changes
The previous functions were replaced with more descriptive and separate ones. No global state is dependent upon (provides = set()).
More idiomatic Python. Ad-hoc directory traversal replaced with os.walk(), metadata processing is no longer in charge of opening the file, lazy generators utilized where possible.
I have run the provided tests on the new version, and no changes in the output were reported.
I have attempted to re-write the nodejs.prov python script to more idiomatic Python and to be more easily modified for downstream purposes (i.e. adapted for software collection purposes).
Since I suspect that maintainers of NodeJS-related software might not also be Pythonistas, I will gladly explain anything confusing in the code (in other words, please help me add comments where necessary 😉).
Notable changes
provides = set()).os.walk(), metadata processing is no longer in charge of opening the file, lazy generators utilized where possible.I have run the provided tests on the new version, and no changes in the output were reported.