From 410d28ede2e65c45ef08475438147a77cb61c63b Mon Sep 17 00:00:00 2001 From: milde Date: Fri, 20 Aug 2010 10:56:48 +0000 Subject: [PATCH] strip whitespace from stylesheet arguments git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils@6393 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- HISTORY.txt | 6 +++++- docutils/utils.py | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index 7a0445e44..3967f66c5 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -29,7 +29,11 @@ Changes Since 0.7 - Fix [ 3001100 ] does not handle spaces in filenames (thanks to Jakub Wilk) - + +* docutils/utils.py: + + - strip whitespace from stylesheet arguments + Release 0.7 (2010-07-07) ======================== diff --git a/docutils/utils.py b/docutils/utils.py index 8bd916e10..7acbf30c8 100644 --- a/docutils/utils.py +++ b/docutils/utils.py @@ -516,14 +516,16 @@ def get_stylesheet_list(settings): """ Retrieve list of stylesheet references from the settings object. """ + assert ( not (settings.stylesheet and settings.stylesheet_path), + 'stylesheet and stylesheet_path are mutually exclusive.') if settings.stylesheet_path: - assert not settings.stylesheet, ( - 'stylesheet and stylesheet_path are mutually exclusive.') - return settings.stylesheet_path.split(",") + sheets = settings.stylesheet_path.split(",") elif settings.stylesheet: - return settings.stylesheet.split(",") + sheets = settings.stylesheet.split(",") else: - return [] + sheets = [] + # strip whitespace (frequently occuring in config files) + return [sheet.strip(u' \t\n\r') for sheet in sheets] def get_trim_footnote_ref_space(settings): """ -- 2.11.4.GIT