diff --git a/create_repository.py b/create_repository.py index 86bef72..4063ead 100644 --- a/create_repository.py +++ b/create_repository.py @@ -3,6 +3,7 @@ import datetime import hashlib import json +import ntpath import zipfile from pathlib import Path @@ -57,6 +58,8 @@ def create_and_get_pcm(path): if not metadata_path.exists(): return + print(f"* create schema for: {path}") + with metadata_path.open("rb") as f: metadata_json = json.load(f) @@ -69,6 +72,7 @@ def create_and_get_pcm(path): if not pkg_path.exists(): # create new package as it does not exist yet (new version) + print(f" * create package: {pkg_path}") create_pcm_from_color_scheme(path, pkg_path) # fill in package data @@ -113,7 +117,15 @@ def write_repository_json(): json.dump(repository_data, f, indent=4) -schema = create_and_get_pcm(ROOT_PATH / "solarized-dark") +if __name__ == "__main__": + # create all package zip files and return the full schema of each one + schemas = [] + for path in ROOT_PATH.iterdir(): + if path.is_dir(): + schema = create_and_get_pcm(path) + if schema: + schemas.append(schema) -write_packages_json([schema]) -write_repository_json() + # write packages.json and repository.json + write_packages_json(schemas) + write_repository_json() diff --git a/packages.json b/packages.json index 18f1007..6e05edd 100644 --- a/packages.json +++ b/packages.json @@ -1,5 +1,75 @@ { "packages": [ + { + "$schema": "https://gitlab.com/qu1ck/kicad/-/raw/pcm/kicad/pcm/schemas/pcm.v1.schema.json#", + "name": "black/white theme", + "description": "black-white color theme", + "description_full": "black-white color theme", + "identifier": "theme-black-white", + "type": "colortheme", + "author": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "maintainer": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "license": "CC0-1.0", + "resources": { + "Github": "https://github.com/pointhi/kicad-color-schemes" + }, + "versions": [ + { + "version": "1.0", + "status": "stable", + "kicad_version": "5.99", + "download_sha256": "8d0a7b4d6df84ef9aac98ce5426f6ccf8375b85f4fd03b6907d7ace3727bf789", + "download_size": 426, + "download_url": "https://raw.githubusercontent.com/pointhi/kicad-color-schemes/master/sw/theme-black-white_v1.0_pcm.zip", + "install_size": 851 + } + ] + }, + { + "$schema": "https://gitlab.com/qu1ck/kicad/-/raw/pcm/kicad/pcm/schemas/pcm.v1.schema.json#", + "name": "solarized-light theme", + "description": "solarized-light color theme", + "description_full": "solarized-light color theme", + "identifier": "theme-solarized-light", + "type": "colortheme", + "author": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "maintainer": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "license": "CC0-1.0", + "resources": { + "Github": "https://github.com/pointhi/kicad-color-schemes" + }, + "versions": [ + { + "version": "1.0", + "status": "stable", + "kicad_version": "5.99", + "download_sha256": "69b95828244851185058788f105a38d9e0f4bf88b5365bc480cac2cfc52d7687", + "download_size": 930, + "download_url": "https://raw.githubusercontent.com/pointhi/kicad-color-schemes/master/solarized-light/theme-solarized-light_v1.0_pcm.zip", + "install_size": 1964 + } + ] + }, { "$schema": "https://gitlab.com/qu1ck/kicad/-/raw/pcm/kicad/pcm/schemas/pcm.v1.schema.json#", "name": "solarized-dark theme", diff --git a/repository.json b/repository.json index 211c190..8721434 100644 --- a/repository.json +++ b/repository.json @@ -8,9 +8,9 @@ }, "name": "kicad-color-schemes repository by @pointhi", "packages": { - "sha256": "49d1375c2c3161845a6c15dcc4f38558cc541817a91d0fa3358d318b8f007f51", - "update_time_utc": "2021-10-30 15:43:26", - "update_timestamp": 1635608606, + "sha256": "3b9af21722a9e6fbd5383499a6b489960627f384f879afd57fe55cb614510636", + "update_time_utc": "2021-10-30 16:03:13", + "update_timestamp": 1635609793, "url": "https://raw.githubusercontent.com/pointhi/kicad-color-schemes/master/packages.json" } } \ No newline at end of file diff --git a/solarized-light/metadata.json b/solarized-light/metadata.json new file mode 100644 index 0000000..a6a0765 --- /dev/null +++ b/solarized-light/metadata.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://gitlab.com/qu1ck/kicad/-/raw/pcm/kicad/pcm/schemas/pcm.v1.schema.json#", + "name": "solarized-light theme", + "description": "solarized-light color theme", + "description_full": "solarized-light color theme", + "identifier": "theme-solarized-light", + "type": "colortheme", + "author": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "maintainer": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "license": "CC0-1.0", + "resources": { + "Github": "https://github.com/pointhi/kicad-color-schemes" + }, + "versions": [{ + "version": "1.0", + "status": "stable", + "kicad_version": "5.99" + }] +} diff --git a/solarized-light/theme-solarized-light_v1.0_pcm.zip b/solarized-light/theme-solarized-light_v1.0_pcm.zip new file mode 100644 index 0000000..86f4b1a Binary files /dev/null and b/solarized-light/theme-solarized-light_v1.0_pcm.zip differ diff --git a/sw/metadata.json b/sw/metadata.json new file mode 100644 index 0000000..866358d --- /dev/null +++ b/sw/metadata.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://gitlab.com/qu1ck/kicad/-/raw/pcm/kicad/pcm/schemas/pcm.v1.schema.json#", + "name": "black/white theme", + "description": "black-white color theme", + "description_full": "black-white color theme", + "identifier": "theme-black-white", + "type": "colortheme", + "author": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "maintainer": { + "name": "Thomas Pointhuber", + "contact": { + "web": "https://github.com/pointhi/kicad-color-schemes/" + } + }, + "license": "CC0-1.0", + "resources": { + "Github": "https://github.com/pointhi/kicad-color-schemes" + }, + "versions": [{ + "version": "1.0", + "status": "stable", + "kicad_version": "5.99" + }] +} diff --git a/sw/theme-black-white_v1.0_pcm.zip b/sw/theme-black-white_v1.0_pcm.zip new file mode 100644 index 0000000..d20d986 Binary files /dev/null and b/sw/theme-black-white_v1.0_pcm.zip differ