mirror of https://github.com/rusefi/KiCad-Diff.git
Merge branch 'sunwukonga-fix-spaces-n-notgitroot'
Added seperate linux executable. Added functionality to manage situations where the *.kicad_pcb is not in the root directory of a git repository. This does not affect SVN or Fossil repos. Deal with spaces in path names
This commit is contained in:
commit
ee216429b4
|
@ -658,6 +658,36 @@ a:hover {
|
|||
|
||||
# ----------------------Main Functions begin here---------------------------------------
|
||||
#
|
||||
|
||||
def getGitPath(prjctName, prjctPath):
|
||||
gitRootCmd = 'cd ' + prjctPath + ' && ' + gitProg + ' rev-parse --show-toplevel'
|
||||
|
||||
gitRootProcess = Popen(
|
||||
gitRootCmd,
|
||||
shell=True,
|
||||
stdin=PIPE,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE,
|
||||
close_fds=True)
|
||||
stdout, stderr = gitRootProcess.communicate()
|
||||
|
||||
gitRoot = stdout.decode('utf-8')
|
||||
|
||||
gitPathCmd = 'cd ' + _escape_string(gitRoot) + ' && ' + gitProg + ' ls-tree -r --name-only HEAD | ' + grepProg + ' -m 1 ' + prjctName
|
||||
|
||||
gitPathProcess = Popen(
|
||||
gitPathCmd,
|
||||
shell=True,
|
||||
stdin=PIPE,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE,
|
||||
close_fds=True)
|
||||
stdout, stderr = gitPathProcess.communicate()
|
||||
|
||||
gitPathProcess.wait()
|
||||
|
||||
return stdout.decode('utf-8')
|
||||
|
||||
def getGitDiff(diff1, diff2, prjctName, prjctPath):
|
||||
'''Given two git artifacts, write out two kicad_pcb files to their respective
|
||||
directories (named after the artifact). Returns the date and time of both commits'''
|
||||
|
@ -694,11 +724,13 @@ def getGitDiff(diff1, diff2, prjctName, prjctPath):
|
|||
if not os.path.exists(outputDir2):
|
||||
os.makedirs(outputDir2)
|
||||
|
||||
gitPath = getGitPath(prjctName, prjctPath)
|
||||
|
||||
gitArtifact1 = 'cd ' + prjctPath + ' && ' + gitProg + ' show ' + artifact1 + \
|
||||
':' + prjctName + ' > ' + outputDir1 + '/' + prjctName
|
||||
':' + gitPath + ' > ' + outputDir1 + '/' + prjctName
|
||||
|
||||
gitArtifact2 = 'cd ' + prjctPath + ' && ' + gitProg + ' show ' + artifact2 + \
|
||||
':' + prjctName + ' > ' + outputDir2 + '/' + prjctName
|
||||
':' + gitPath + ' > ' + outputDir2 + '/' + prjctName
|
||||
|
||||
print(gitArtifact1, gitArtifact2)
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,6 +5,7 @@ Kicad plot pcb file.
|
|||
Plot variety of svg files in plot directory
|
||||
'''
|
||||
|
||||
import sys
|
||||
import pcbnew
|
||||
from pcbnew import *
|
||||
|
||||
|
|
Loading…
Reference in New Issue