diff options
author | Georg Brandl <georg@python.org> | 2010-10-22 11:16:48 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-22 11:16:48 +0200 |
commit | db8189083d6022a34b331d4c482776ba301eae1b (patch) | |
tree | 4772befc0e005a3cd7f7377d6c5777a8f24ec43b /sphinx/application.py | |
parent | 92f6212c98871ddba777524039d8b1950a069c53 (diff) | |
parent | 357f8472c7f8b7772d27c561215bc8f981f13001 (diff) | |
download | sphinx-git-db8189083d6022a34b331d4c482776ba301eae1b.tar.gz |
merge with 1.0
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 97b1b396d..cd4503a64 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -209,6 +209,12 @@ class Sphinx(object): self.builder.cleanup() def warn(self, message, location=None, prefix='WARNING: '): + if isinstance(location, tuple): + docname, lineno = location + if docname: + location = '%s:%s' % (self.env.doc2path(docname), lineno or '') + else: + location = None warntext = location and '%s: %s%s\n' % (location, prefix, message) or \ '%s%s\n' % (prefix, message) if self.warningiserror: |