summaryrefslogtreecommitdiff
path: root/sphinx/web/util.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-16 20:27:25 +0000
committerGeorg Brandl <georg@python.org>2008-01-16 20:27:25 +0000
commitb09e628b0f33614e81521ad60e94472a0db09a4d (patch)
tree9fde04d85255a2f7569f8f10def1f2cfe70f303e /sphinx/web/util.py
parent1fbdc410b71ab6515ad576ef277700b9dba92d47 (diff)
downloadsphinx-git-b09e628b0f33614e81521ad60e94472a0db09a4d.tar.gz
A few refactorings in Sphinx.
Diffstat (limited to 'sphinx/web/util.py')
-rw-r--r--sphinx/web/util.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/web/util.py b/sphinx/web/util.py
index 1723f122b..c69c96dfd 100644
--- a/sphinx/web/util.py
+++ b/sphinx/web/util.py
@@ -8,22 +8,21 @@
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
-from __future__ import with_statement
import re
from os import path
-from ..util import relative_uri
-from .._jinja import Environment, FileSystemLoader
+from sphinx.util import relative_uri
+from sphinx._jinja import Environment, FileSystemLoader
def get_target_uri(source_filename):
- """Get the web-URI for a given reST file name."""
- if source_filename == 'index.rst':
+ """Get the web-URI for a given reST file name (without extension)."""
+ if source_filename == 'index':
return ''
- if source_filename.endswith('/index.rst'):
- return source_filename[:-9] # up to /
- return source_filename[:-4] + '/'
+ if source_filename.endswith('/index'):
+ return source_filename[:-5] # up to /
+ return source_filename + '/'
# ------------------------------------------------------------------------------