Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/iterator/doc/scanrst.py @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1014 bytes
Line 
1# Copyright David Abrahams 2004. Use, modification and distribution is
2# subject to the Boost Software License, Version 1.0. (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5# This script accepts a list of .rst files to be processed and
6# generates Makefile dependencies for .html and .rst files to stdout.
7import os,sys
8import re
9
10include = re.compile(r' *\.\. +(include|image):: +(.*)', re.MULTILINE)
11
12def deps(path, found):
13    dir = os.path.split(path)[0]
14    for m in re.findall(include, open(path).read()):
15
16        dependency = os.path.normpath(os.path.join(dir,m[1]))
17        if dependency not in found:
18            found[dependency] = 1
19
20            if m[0] == 'include':
21                deps(dependency, found)
22               
23    return found
24               
25for file in sys.argv[1:]:
26    found = deps(file, {})
27    if found:
28        base = os.path.splitext(os.path.basename(file))[0]
29        print '%s.tex %s.html: %s' % (base, base, ' '.join(found.keys()))
Note: See TracBrowser for help on using the repository browser.