Skip to content

Commit 458be66

Browse files
Working on python scripts
1 parent 72b83db commit 458be66

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

Conversion/Python/EagleLibInfo.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
import os
22
from lxml import etree
33
from lxml import objectify
4-
5-
myFileName = "C:\github\SparkFun-Eagle-Libraries\SparkFun-IC-Conversion.lbr"
6-
7-
statinfo = os.stat(myFileName)
8-
9-
myFile = open(myFileName, "r")
10-
#print myFile.read(statinfo.st_size)
4+
import sys
5+
6+
print"" # print a new line
7+
8+
numArgs = len(sys.argv)
9+
if numArgs < 2:
10+
#Print help
11+
print "Not enough arguments"
12+
print "Example: Python file.py C:\github\SparkFun-Eagle-Libraries\SparkFun-IC-Conversion.lbr"
13+
exit()
14+
15+
myFileName = sys.argv[1]
16+
17+
if os.path.isfile(myFileName) == True:
18+
statinfo = os.stat(myFileName)
19+
myFile = open(myFileName, "r")
20+
else:
21+
print "Invalid file name"
22+
exit()
23+
24+
#print myFile.read(statinfo.st_size)
1125

1226
#root = objectify.parse(myFileName)
1327
root = objectify.fromstring(myFile.read(statinfo.st_size))

Conversion/TestLibs/testLibrary.dcm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
EESchema-DOCLIB Version 2.0
22
#
33
$CMP AT25SF041
4-
D This is a test part for testing where does this description get displayed?
4+
D <h3>VS1000D</h3>
5+
D <p>Ogg Vorbis Player IC with USB and NAND FLASH Interface 12 MHz LQFP-48</p>
6+
D <h3></h3>
7+
D <p></p>
8+
D <p><a href="">Datasheet</a></p>
9+
D <h4>SparkFun Products</h4>
10+
D <ul>
11+
D <li><a href="https://www.sparkfun.com/products/8300">Storefront component: Ogg Vorbis Codec IC - VS1000D</a> (COM-08300)</li>
512
K ALICE BOB PROD_ID:CRP-0001
613
$ENDCMP
714
#

0 commit comments

Comments
 (0)