aboutsummaryrefslogtreecommitdiff
path: root/circuitpython/tools/mpconfig_category_reader.py
blob: 7c2aede5b95269d7572897d3a1a502cf9f27bf00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
filepath = "../py/circuitpy_mpconfig.mk"
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)