1 #!/usr/local/bin/python3.0
10 if not os.path.exists("data/03"):
11 os.makedirs("data/03")
13 treg = re.compile("data/02/[0-9a-f]{2,2}/[0-9a-f]{32,32}/([0-9a-f]{32,32})")
15 for path, dirs, files in os.walk("data/02"):
17 tfile = os.path.join(path, file)
18 match = treg.match(tfile)
20 decofiles[match.group(1)] = tfile
21 print("Decofiles isolated: %d" % len(decofiles))
24 for path, dirs, files in os.walk("data/03"):
25 colfiles.update({file:os.path.join(path, file) for file in files})
26 print("Colfiles isolated: %d" % len(colfiles))
29 touchfiles = sorted(set([tag for tag in colfiles.keys()]) | set([tag for tag in decofiles.keys()]))
32 nmatch = re.compile("[^:]+: (.*)")
33 for tag in touchfiles:
34 assert(tag in decofiles)
35 if not tag in colfiles:
36 print("Linking %s" % tag)
37 if not os.path.exists("data/03/%s" % (tag[0:2])):
38 os.makedirs("data/03/%s" % (tag[0:2]))
39 os.link(decofiles[tag], "data/03/%s/%s" % (tag[0:2], tag))