From 716ecadbc10a8ab9b16424baf5bb4958fa75b461 Mon Sep 17 00:00:00 2001
From: polymurph <eddyed.k@gmail.com>
Date: Tue, 17 Oct 2023 20:56:44 +0200
Subject: [PATCH] added file creation feature for project specific library
 linkage to KicED

---
 project_init_tool/KicED_libLinker.py | 33 +++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/project_init_tool/KicED_libLinker.py b/project_init_tool/KicED_libLinker.py
index bc4b286..9c5695a 100644
--- a/project_init_tool/KicED_libLinker.py
+++ b/project_init_tool/KicED_libLinker.py
@@ -45,13 +45,36 @@ baseRelativeBasePath = os.path.join("${KIPRJMOD}", relative_path)
 
 print(baseRelativeBasePath)
 
-
 fps = getFootprinLibrarys(footprintPath)
+sps = getSymbolsLibrarys(symbolsPath)
 
+temp = []
 for f in fps:
-    print(f)
-
-sps = getSymbolsLibrarys(symbolsPath)
+    pth = os.path.join(baseRelativeBasePath, "symbols")
+    temp.append(os.path.join(pth, f))
+fps = temp
 
+temp = []
 for f in sps:
-    print(f)
\ No newline at end of file
+    pth = os.path.relpath(f,cwd)
+    pth = os.path.join(baseRelativeBasePath,pth)
+    temp.append(pth)
+sps = temp
+
+if 1:
+    for f in fps:
+        print(f)
+
+    for f in sps:
+        print(f)
+
+
+os.chdir(pathToProjectFolder)
+print(pathToProjectFolder)
+try:
+    with open("sym-lib-table",'w') as file:
+        file.write("(fp_lib_table\n  (version 7)\n)")
+        os.chdir(cwd)
+except FileNotFoundError:
+    print("fail")
+    os.chdir(cwd)
\ No newline at end of file