Commits

Anonymous committed bf3bfec

Follow links when searching documents and document changes from Armin.

Comments (0)

Files changed (2)

 
   and putting ``'index': name of your template`` in ``html_additional_pages``.
 
+* In the layout template, redundant ``block``\s were removed; you should use
+  Jinja's standard ``{{ super() }}`` mechanism instead.
+
 New features added
 ------------------
 
 * sphinx.builder, sphinx.environment: Gracefully handle some user error
   cases.
 
+* sphinx.util: Follow symbolic links when searching for documents.
+
 
 Release 0.1.61950 (Mar 26, 2008)
 ================================

sphinx/util/__init__.py

             raise
 
 
+def walk(top, topdown=True, followlinks=False):
+    """
+    Backport of os.walk from 2.6, where the followlinks argument was added.
+    """
+    names = os.listdir(top)
+
+    dirs, nondirs = [], []
+    for name in names:
+        if path.isdir(path.join(top, name)):
+            dirs.append(name)
+        else:
+            nondirs.append(name)
+
+    if topdown:
+        yield top, dirs, nondirs
+    for name in dirs:
+        fullpath = path.join(top, name)
+        if followlinks or not path.islink(fullpath):
+            for x in walk(fullpath, topdown, followlinks):
+                yield x
+    if not topdown:
+        yield top, dirs, nondirs
+
+
 def get_matching_docs(dirname, suffix, exclude=(), prune=()):
     """
     Get all file names (without suffix) matching a suffix in a
     # dirname is a normalized absolute path.
     dirname = path.normpath(path.abspath(dirname))
     dirlen = len(dirname) + 1    # exclude slash
-    for root, dirs, files in os.walk(dirname):
+    for root, dirs, files in walk(dirname, followlinks=True):
         dirs.sort()
         files.sort()
         for prunedir in prune: