diff options
| author | Georg Brandl <georg@python.org> | 2009-12-31 09:49:12 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2009-12-31 09:49:12 +0100 |
| commit | 23cd8a9f62d9c4d8ec6e46165c42b2268c485bbe (patch) | |
| tree | f7e1b042614383a3a04a3dc9c54c8d08c1200098 | |
| parent | f6c34f0f716306ae88b03911742f4b5ac4f4f22c (diff) | |
| parent | b30efd8a9304fa4f8076a703eff343f966dbe2c9 (diff) | |
| download | sphinx-23cd8a9f62d9c4d8ec6e46165c42b2268c485bbe.tar.gz | |
merge with 0.6
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | sphinx/cmdline.py | 4 | ||||
| -rw-r--r-- | tests/root/_templates/layout.html | 3 | ||||
| -rw-r--r-- | tests/root/conf.py | 2 | ||||
| -rw-r--r-- | tests/test_build.py | 2 |
5 files changed, 10 insertions, 4 deletions
@@ -49,6 +49,9 @@ Release 1.0 (in development) Release 0.6.4 (in development) ============================== +* #303: ``html_context`` values given on the command line via ``-A`` + should not override other values given in conf.py. + * Fix a bug preventing incremental rebuilds for the ``dirhtml`` builder. diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index 898678b7..ae8b076b 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -96,7 +96,6 @@ def main(argv): error = sys.stderr warnfile = None confoverrides = {} - htmlcontext = {} tags = [] doctreedir = path.join(outdir, '.doctrees') for opt, val in opts: @@ -142,7 +141,7 @@ def main(argv): val = int(val) except ValueError: pass - htmlcontext[key] = val + confoverrides['html_context.%s' % key] = val elif opt == '-N': nocolor() elif opt == '-E': @@ -158,7 +157,6 @@ def main(argv): warnfile = val elif opt == '-P': use_pdb = True - confoverrides['html_context'] = htmlcontext if warning and warnfile: warnfp = open(warnfile, 'w') diff --git a/tests/root/_templates/layout.html b/tests/root/_templates/layout.html index e8920025..7f290fc1 100644 --- a/tests/root/_templates/layout.html +++ b/tests/root/_templates/layout.html @@ -1,5 +1,8 @@ {% extends "!layout.html" %} {% block extrahead %} +{# html_context variable from conf.py #} <meta name="hc" content="{{ hckey }}" /> +{# html_context variable from confoverrides (as if given on cmdline) #} +<meta name="hc_co" content="{{ hckey_co }}" /> {{ super() }} {% endblock %} diff --git a/tests/root/conf.py b/tests/root/conf.py index fd82be7d..192a1883 100644 --- a/tests/root/conf.py +++ b/tests/root/conf.py @@ -35,7 +35,7 @@ html_theme_options = {'testopt': 'testoverride'} html_style = 'default.css' html_static_path = ['_static'] html_last_updated_fmt = '%b %d, %Y' -html_context = {'hckey': 'hcval'} +html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'} htmlhelp_basename = 'SphinxTestsdoc' diff --git a/tests/test_build.py b/tests/test_build.py index d7b19474..c98b8de9 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -108,6 +108,7 @@ HTML_XPATH = { }, 'contents.html': { ".//meta[@name='hc'][@content='hcval']": '', + ".//meta[@name='hc_co'][@content='hcval_co']": '', ".//meta[@name='testopt'][@content='testoverride']": '', #".//td[@class='label']": r'\[Ref1\]', # docutils 0.5 only ".//td[@class='label']": '', @@ -181,6 +182,7 @@ def check_xpath(etree, fname, path, check): [node.text for node in nodes])) @gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True, + confoverrides={'html_context.hckey_co': 'hcval_co'}, tags=['testtag']) def test_html(app): app.builder.build_all() |
