commit
86d84cc2af
2 changed files with 30 additions and 0 deletions
10
README.md
10
README.md
|
@ -14,6 +14,16 @@ Use a text editor to overwrite the relevant sections with the data found in the
|
|||
|
||||
The pcbnew config file content has been split into the sections responsible for the footprint editor and the one for pcbnew. This is done to allow you to more easily mix and match different schemes for different tools.
|
||||
|
||||
## Automatic patcher
|
||||
|
||||
You can use patch.py to automatically patch the configuration files. The python script searches for settings that have to be overwritten and appends all new settings to the end of the file.
|
||||
|
||||
`python3.6 patch.py <patch file> <config file>`
|
||||
|
||||
For example:
|
||||
|
||||
`python3.6 patch.py ~/kicad-color-schemes/blue-green-dark/pcbnew ~/.config/kicad/pcbnew`
|
||||
|
||||
## eeschema
|
||||
|
||||
color-scheme | screenshot
|
||||
|
|
20
patch.py
Executable file
20
patch.py
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/python3.6
|
||||
import sys
|
||||
|
||||
patch=open(sys.argv[1], "r").readlines()
|
||||
orig=open(sys.argv[2],"r")
|
||||
origlines = orig.readlines()
|
||||
|
||||
for idx,oline in enumerate(origlines):
|
||||
osubst = oline.split('=')
|
||||
for idx1,pline in enumerate(patch):
|
||||
psubst = pline.split('=')
|
||||
if osubst[0] == psubst[0]:
|
||||
origlines[idx] = pline
|
||||
patch.pop(idx1)
|
||||
origlines += patch
|
||||
orig.close
|
||||
|
||||
new=open(sys.argv[2],"w")
|
||||
new.writelines(origlines)
|
||||
new.close
|
Loading…
Reference in a new issue