summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-15 22:27:04 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-15 22:27:04 +0000
commit8f18f1a35188e8542cbe659d59bb3b8910653a77 (patch)
tree25a72776848405a42647b30fba3355bdf4277ccc
parent5f5381734f9bc412a93b8279d9d16d2197f50b09 (diff)
downloaddocutils-8f18f1a35188e8542cbe659d59bb3b8910653a77.tar.gz
Bugfix: do not make "stylesheet-path"s absolute.
The --stylesheet-path arguments are searched in the --stylesheet-dirs, therefore must not be made absolute before. Thanks to Martin Gignac for tracking down the bug. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7630 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/writers/html4css1/__init__.py2
-rw-r--r--docutils/writers/latex2e/__init__.py2
-rw-r--r--docutils/writers/pep_html/__init__.py3
-rwxr-xr-xtest/test_settings.py6
-rwxr-xr-xtest/test_writers/test_html4css1_misc.py10
5 files changed, 14 insertions, 9 deletions
diff --git a/docutils/writers/html4css1/__init__.py b/docutils/writers/html4css1/__init__.py
index 0afa5f323..bf0749428 100644
--- a/docutils/writers/html4css1/__init__.py
+++ b/docutils/writers/html4css1/__init__.py
@@ -154,8 +154,6 @@ class Writer(writers.Writer):
settings_defaults = {'output_encoding_error_handler': 'xmlcharrefreplace'}
- relative_path_settings = ('stylesheet_path',)
-
config_section = 'html4css1 writer'
config_section_dependencies = ('writers',)
diff --git a/docutils/writers/latex2e/__init__.py b/docutils/writers/latex2e/__init__.py
index 3d1676f65..08296ae01 100644
--- a/docutils/writers/latex2e/__init__.py
+++ b/docutils/writers/latex2e/__init__.py
@@ -217,8 +217,6 @@ class Writer(writers.Writer):
settings_defaults = {'sectnum_depth': 0 # updated by SectNum transform
}
- relative_path_settings = ('stylesheet_path',)
-
config_section = 'latex2e writer'
config_section_dependencies = ('writers',)
diff --git a/docutils/writers/pep_html/__init__.py b/docutils/writers/pep_html/__init__.py
index 0d09024d6..0ad79e01d 100644
--- a/docutils/writers/pep_html/__init__.py
+++ b/docutils/writers/pep_html/__init__.py
@@ -52,8 +52,7 @@ class Writer(html4css1.Writer):
settings_default_overrides = {'stylesheet_path': default_stylesheet_path,
'template': default_template_path,}
- relative_path_settings = (html4css1.Writer.relative_path_settings
- + ('template',))
+ relative_path_settings = ('template',)
config_section = 'pep_html writer'
config_section_dependencies = ('writers', 'html4css1 writer')
diff --git a/test/test_settings.py b/test/test_settings.py
index bde80328f..397c1de1f 100755
--- a/test/test_settings.py
+++ b/test/test_settings.py
@@ -44,7 +44,7 @@ class ConfigFileTests(unittest.TestCase):
u'python_home': u'http://www.python.org',
u'source_link': True,
'stylesheet': None,
- u'stylesheet_path': [fixpath(u'data/stylesheets/pep.css')],
+ u'stylesheet_path': [u'stylesheets/pep.css'],
'template': fixpath(u'data/pep-html-template')},
'one': {u'datestamp': u'%Y-%m-%d %H:%M UTC',
u'generator': True,
@@ -54,7 +54,7 @@ class ConfigFileTests(unittest.TestCase):
'record_dependencies': utils.DependencyList(),
u'source_link': True,
'stylesheet': None,
- u'stylesheet_path': [fixpath(u'data/stylesheets/pep.css')],
+ u'stylesheet_path': [u'stylesheets/pep.css'],
u'tab_width': 8,
u'template': fixpath(u'data/pep-html-template'),
u'trim_footnote_reference_space': True,
@@ -63,7 +63,7 @@ class ConfigFileTests(unittest.TestCase):
u'generator': False,
'record_dependencies': utils.DependencyList(),
u'stylesheet': None,
- u'stylesheet_path': [fixpath(u'data/test.css')],
+ u'stylesheet_path': [u'test.css'],
'trim_footnote_reference_space': None},
'list': {u'expose_internals': [u'a', u'b', u'c', u'd', u'e'],
u'strip_classes': [u'spam', u'pan', u'fun', u'parrot'],
diff --git a/test/test_writers/test_html4css1_misc.py b/test/test_writers/test_html4css1_misc.py
index 0741b9cee..684894619 100755
--- a/test/test_writers/test_html4css1_misc.py
+++ b/test/test_writers/test_html4css1_misc.py
@@ -81,6 +81,16 @@ class SettingsTestCase(DocutilsTestSupport.StandardTestCase):
self.assertIn('docutils/writers/html4css1/html4css1.css', styles)
self.assertIn('href="data/ham.css"', styles)
+ def test_custom_stylesheet_dir_embedded(self):
+ mysettings = {'_disable_config': True,
+ 'embed_stylesheet': True,
+ 'stylesheet_dirs': ('../docutils/writers/html4css1/',
+ 'data'),
+ 'stylesheet_path': 'ham.css'}
+ styles = core.publish_parts(self.data, writer_name='html4css1',
+ settings_overrides=mysettings)['stylesheet']
+ self.assertIn('dl.docutils dd {\n margin-bottom: 0.5em }', styles)
+
class MathTestCase(DocutilsTestSupport.StandardTestCase):
"""Attention: This class tests the current implementation of maths support