aboutsummaryrefslogtreecommitdiffstats
path: root/packages/aspell/aspell-0.50.5/mk-dirs_h.py
blob: a487751e8155bd244262ec2c8494cc09d13a4151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python

import sys

prefix=sys.argv[1]
key=sys.argv[2]
value=sys.argv[3]

while prefix[-1] == '/':
    prefix = prefix[:-2]

plen = len(prefix)

if value[:plen] == prefix:
    value = value[plen:]
    while value[0] == '/':
        value = value[1:]
    print "#define " + key + " \"<prefix:" + value + ">\"\n"
else:
    print "#define " + key + " \"" + value + "\"\n"