From c90d6cc52f8209fe407dee57e4d9a1f785f06fee Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 15 May 2011 13:41:29 +0200 Subject: [PATCH] Closes #98: mention original copyright owners, and port fix from https://bitbucket.org/thomaswaldmann/sphinx-autopackage-script/changeset/dba2b779c1af. --- sphinx/apidoc.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 86ed04d06..af4043336 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -7,7 +7,10 @@ ReST files appropriately to create code documentation with Sphinx. It also creates a modules index (named modules.). - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + This is derived from the "sphinx-autopackage" script, which is: + Copyright 2008 Société des arts technologiques (SAT), http://www.sat.qc.ca/. + + :copyright: 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os @@ -134,9 +137,12 @@ def recurse_tree(rootpath, excludes, opts): Look for every file in the directory tree and create the corresponding ReST files. """ + # use absolute path for root, as relative paths like '../../foo' cause + # 'if "/." in root ...' to filter out *all* modules otherwise + rootpath = os.path.abspath(rootpath) # check if the base directory is a package and get is name if INITPY in os.listdir(rootpath): - package_name = path.abspath(rootpath).split(path.sep)[-1] + package_name = rootpath.split(path.sep)[-1] else: package_name = None