circuitpython/tools/mpconfig_category_reader.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
875 B
Python
Raw Normal View History

2021-03-15 09:57:36 -04:00
filepath = "../py/circuitpy_mpconfig.mk"
2020-08-26 17:37:05 -04:00
with open(filepath) as fp:
line = fp.readline()
cnt = 1
fullbuild = []
defon = []
defoff = []
while line:
wordlist = line.split()
if wordlist:
if wordlist[-1] == "$(CIRCUITPY_FULL_BUILD)":
fullbuild.append(wordlist[0])
elif wordlist[-1] == "0":
defoff.append(wordlist[0])
elif wordlist[-1] == "1":
defon.append(wordlist[0])
line = fp.readline()
cnt += 1
print(str(cnt) + " Lines Read\n")
print("\nFULL BUILDS ------------------------")
for string in fullbuild:
print(string)
print("\nON BUILDS ------------------------")
for string in defon:
print(string)
print("\nOFF BUILDS ------------------------")
for string in defoff:
print(string)