summaryrefslogtreecommitdiff
path: root/docs/src/links_db_gen.py
blob: 756b423e38507eb29504326a421a2eea334fd98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

import os, sys

d = {}

strip = sys.argv[1]

for f in sys.argv[2:]:
	base = os.path.splitext(f)[0]
	if base.startswith(strip):
		base = base[len(strip):]
	for l in open(f):
		l = l.strip().replace(' ', '_')
		if not l:
			continue
		d[l] = base
for k, v in d.items():
	print '%s\t%s' % (k, v)