You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
906B

  1. import sys
  2. import json
  3. import os
  4. import glob
  5. filenames = sys.argv[1:]
  6. for filename in filenames:
  7. # Read plugin manifest
  8. try:
  9. with open(filename, "r") as f:
  10. manifest = json.load(f, strict=False)
  11. except Exception as e:
  12. print(f"Could not parse {filename}")
  13. print(e)
  14. continue
  15. slug = os.path.splitext(os.path.basename(filename))[0]
  16. # dest_filename = f"manifests/{slug}.json"
  17. # if os.path.isfile(dest_filename):
  18. # continue
  19. if manifest.get('manualUrl', '') and manifest.get('pluginUrl', '') and manifest.get('author', '') and manifest.get('authorEmail', '') and manifest.get('authorUrl', '') and manifest.get('sourceUrl', '') and manifest.get('donateUrl', ''):
  20. print(slug)
  21. # # Write library manifest
  22. # slug = manifest["slug"]
  23. # manifest_filename = f"manifests/{slug}.json"
  24. # with open(manifest_filename, "w") as f:
  25. # json.dump(manifest, f, indent=" ")
  26. # print(f"Copied {slug}")