1234567891011121314151617181920212223242526272829 |
- import sys, re
- NR_LEVELS = 4
- objdir = sys.argv[1]
- stem = objdir[objdir.rfind('/out'):]
- m = re.match('/[^/]*'*NR_LEVELS+'(/.*)?', stem)
- stem = '' if m.group(1) is None else m.group(1)
- srcdir = '../'*(NR_LEVELS+stem.count('/')) + 'src' + stem
- print(srcdir)
|