diff options
author | blackbird <blackbird@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2007-05-26 09:45:11 +0000 |
---|---|---|
committer | blackbird <blackbird@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2007-05-26 09:45:11 +0000 |
commit | c44e6e89e01f1c72d429e9c4ec393c0f0e399001 (patch) | |
tree | 7e430bb38de526b6289e8ecb7902a787161ddf5f /sandbox/py-rest-doc/sphinx/environment.py | |
parent | 00fcc06250b10fddf7fd9fdebfcec5b2c957df32 (diff) | |
download | docutils-c44e6e89e01f1c72d429e9c4ec393c0f0e399001.tar.gz |
oopified admin panel
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5154 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/py-rest-doc/sphinx/environment.py')
-rw-r--r-- | sandbox/py-rest-doc/sphinx/environment.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sandbox/py-rest-doc/sphinx/environment.py b/sandbox/py-rest-doc/sphinx/environment.py index b131d416c..a3bc17b43 100644 --- a/sandbox/py-rest-doc/sphinx/environment.py +++ b/sandbox/py-rest-doc/sphinx/environment.py @@ -677,3 +677,14 @@ class BuildEnvironment: result.append((best_res, type, filename, title, desc)) return heapq.nlargest(n, result) + + def get_real_filename(self, filename): + """ + Pass this function a filename without .rst extension to + get the real filename. This also resolves the special + `index.rst` files. If the file does not exist the return + value will be `None`. + """ + for rstname in filename + '.rst', filename + path.sep + 'index.rst': + if rstname in self.mtimes: + return rstname |