summaryrefslogtreecommitdiff
path: root/timings.py
blob: 7ee491b8d587df0a08dbc5eb5206c29c94075218 (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
#!/usr/bin/env python3
import sys, os

def safeChar(c):
    if c.isalnum():
        return c
    else:
        return "_{:02X}".format(ord(c))

name = sys.argv[1]
safename = "".join(safeChar(c) for c in name)

for fname in os.listdir("comp_cache"):
    parts = fname.split(".")[0].split("-")
    if safename in parts[0:2]:
        with open("comp_cache/" + fname) as f:
            contents = f.read().strip()
        
        if safename == parts[0]:
            timing = contents.split()[3]
        else:
            timing = contents.split()[4]

        print(timing)