-
-
Save Bouni/cf1e5fde1d35ddd71f98d12781353897 to your computer and use it in GitHub Desktop.
| import json | |
| import os | |
| import re | |
| appdata = os.getenv("appdata") | |
| basepath = os.path.join(appdata, "kicad", "6.99") | |
| jsonpath = os.path.join(basepath, "kicad_common.json") | |
| fplibpath = os.path.join(basepath, "fp-lib-table") | |
| symlibpath = os.path.join(basepath, "sym-lib-table") | |
| with open(jsonpath) as f: | |
| j = json.load(f) | |
| if "EASYEDA2KICAD" in j["environment"]["vars"]: | |
| print("EASYEDA2KICAD env var already set") | |
| else: | |
| print("EASYEDA2KICAD env var not set!") | |
| with open(fplibpath) as f: | |
| match = re.search(r"EASYEDA2KICAD", f.read()) | |
| if "EASYEDA2KICAD" in j["environment"]["vars"]: | |
| print("EASYEDA2KICAD footprint lib already set") | |
| else: | |
| print("EASYEDA2KICAD footprint lib not set!") | |
| with open(symlibpath) as f: | |
| match = re.search(r"EASYEDA2KICAD", f.read()) | |
| if "EASYEDA2KICAD" in j["environment"]["vars"]: | |
| print("EASYEDA2KICAD symbol lib already set") | |
| else: | |
| print("EASYEDA2KICAD symbol lib not set!") |
Whats the version number, 6.0 or 6.99 !? Add for both!? -> Ideally, for all kicad version
Is Kicad always installed on drive C: !? -> if it's fail to do it automatically, the user will be warned and must do it manually
Maybe you could create some kind of install script that has a wizard which guides the user throug the process and asks for the correct values!?
Is Kicad always installed on drive C: !?
Actually this doesnt matter as the Roaming directory is always at the same place and can be looked up using the env var %appdata%!
Just updated the head of the script to use the appdata env var
That's really great !
But works only for Windows. I don't know how are located files in linux os.
Let me see if I can figure that out, but need to waid for the lunch break to do that 😅
Sure :)
I just create a Ubuntu VM and installed Kicad 6.0, there the config path is ~/.config/kicad/6.0/ and the 3 files are in there.
Okay thanks a lot !
I just create a Ubuntu VM and installed Kicad 6.0, there the config path is
~/.config/kicad/6.0/and the 3 files are in there.
That only works for Kicad versions 6.x+ Kicad 5.x uses something different. Also, I think Kicad 6.x+ uses ~/.local/share/kicad/6.0/* by default.
@ayourk this maybe differs between distros 🤔
I do have both a ~/.config/kicad/6.0/ and a ~/.local/share/kicad/6.0/. Maybe I'm confusing the 2?
Known issues: