From 80ef42a1e858cf1adf6d9f590a95b3306bed9539 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sat, 30 Oct 2021 18:05:06 +0200 Subject: [PATCH] Add metadata.json to themes created by me --- create_repository.py | 18 ++++- packages.json | 70 ++++++++++++++++++ repository.json | 6 +- solarized-light/metadata.json | 29 ++++++++ .../theme-solarized-light_v1.0_pcm.zip | Bin 0 -> 930 bytes sw/metadata.json | 29 ++++++++ sw/theme-black-white_v1.0_pcm.zip | Bin 0 -> 426 bytes 7 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 solarized-light/metadata.json create mode 100644 solarized-light/theme-solarized-light_v1.0_pcm.zip create mode 100644 sw/metadata.json create mode 100644 sw/theme-black-white_v1.0_pcm.zip 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 0000000000000000000000000000000000000000..86f4b1a618899cb5ed0f3a3f9a4c7432b67e418f GIT binary patch literal 930 zcmWIWW@Zs#U|`^2aGMYp+-bLIlMy2WLozc1120fCH?<@&C9xz?FRM5|?`+WCyh8>8 z_bR(I-g+b%l{8FUnBATi+A8y0L9cJ_FTDj~AKz`&Unp?J>#f@okMf=G_0#3mJS#3$ zhnSie#j0fbUU}ry(W|C>I%cQap7PdPU2DTO3C;Xaq#t#ar*=)1(J`z0qLufb<-d3n zYxS0QO^(8<#m1Lj`>!xsY;LM5vY>z|wBgk2XMvAd{`V}ul|s8(h|O(WfOIHW6s^kEj?I!;`!%;?@Np3 z)G!9X1NU1;f57bX&yE!V1J{#*MURxmfP1Kd;D6B z$p3ty{wOXjm%Sg9wLDl3%c|H=o9sKpb3O;P)neSNcv`{svx}bP@ z;&JJWnSwQbAx3p;w!Yd}6tzn)K4Y2-qwn^zg+EtM*WN13-ZE2Jg=>=umxs{#i2FY) zHWe@2J5{lG&gySV1TKgyUA0eL^Z2C}E3?W2tL}L;KKM8{SZ!l;TJwTR#wcyu&LHoU zZ{F`0a$nZi5OC&BLwt-So>>^V)ygT(^lh@w6`S!e>!?K^} zzeioY{{-C}{|7ZcLKl5I?NhU>@6~pdEgv;DbbqjzD)r2|==S*?{6Eu-f9_Rt{=^#K m&B!Fej5}z7p$i5}8bK6FKnHlUvVjB{fzTRAM*?GnfdK$t#jC~u literal 0 HcmV?d00001