Created
August 22, 2020 14:20
-
-
Save nanonyme/9f9a64de5d38bff440924b1324f0e06b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import yaml | |
import sys | |
import os | |
import os.path | |
def main(filename): | |
with open(filename) as file: | |
data = yaml.load(file, Loader=yaml.CLoader) | |
for project, elements in data["projects"].items(): | |
for element, refs in data["projects"][project].items(): | |
with open(f"elements/{element}", "a") as file: | |
file.write(f" ref: {refs[0]['ref']}\n") | |
if __name__ == "__main__": | |
main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment