getpelican/pelican — pull request #1084 by karmadharma (2013-09-16 06:18:08+00:00)
Title: Support for pygment defaults and relevant documentation

As the subject says this is adding support for pygments defaults in pelican.conf, so if users want to, say, have line numbers for all their RST code blocks and a unique css identifier they can set them in pelican.conf instead of having to have them in every block.

Unfortunately docutils directive handlers do not seem to have a way to get custom variables or hook methods, so I had to resort to a global in settings.py. Tests pass in python 2.x from the command line, and have the usual (for my environment) French/Turkish locale failure in python 3.x. When running from tox I get an additional failure in python 2.x related to typogrify that I don't get when running directly, but it might be possibly related to the tox deps being newer than the ones I have installed in my virtualenv, here is the full tox log

```
GLOB sdist-make: github/pelican/pelican/setup.py
py27 inst-nodeps: github/pelican/pelican/.tox/dist/pelican-3.3.zip
py27 runtests: commands[0] | python -m unittest discover
.....................................sssssssss...ss...............github/pelican/pelican/.tox/py27/lib/python2.7/site-packages/smartypants.py:247: DeprecationWarning: smartyPants function will be removed at Version 2.0.0, use smartypants, instead
warnings.warn(msg, DeprecationWarning)
F........................
======================================================================
FAIL: test_typogrify (pelican.tests.test_readers.RstReaderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "github/pelican/pelican/pelican/tests/test_readers.py", line 122, in test_typogrify
self.assertEqual(page.content, expected)
AssertionError: u'

This is some content. With some stuff to "typogrify".

\n< [truncated]... != u'

This is some content. With some stuff to “typogrify”.

\ [truncated]...
-

This is some content. With some stuff to "typogrify".

? ^^^^ ^^^^
+

This is some content. With some stuff to “typogrify”.

? ^^^^^ ^^^^^

Now with added support for TLA.

----------------------------------------------------------------------
Ran 91 tests in 1.821s

FAILED (failures=1, skipped=11)
ERROR: InvocationError: 'github/pelican/pelican/.tox/py27/bin/python -m unittest discover'
py33 inst-nodeps: github/pelican/pelican/.tox/dist/pelican-3.3.zip
py33 runtests: commands[0] | python -m unittest discover
..github/pelican/pelican/pelican/tests/test_contents.py:195: DeprecationWarning: Please use assertEqual instead.
self.assertEquals(content, ('A simple test, with a '
...................................sssssssss...ss.........................FF.............
======================================================================
FAIL: test_french_locale (pelican.tests.test_utils.TestDateFormatter)
----------------------------------------------------------------------
Traceback (most recent call last):
File "github/pelican/pelican/pelican/tests/test_utils.py", line 377, in test_french_locale
utils.strftime(self.date, 'date = %A, %d %B %Y'))
AssertionError: 'date = Mercredi, 29 aoÃ»t 2012' != 'date = Mercredi, 29 août 2012'
- date = Mercredi, 29 aoÃ»t 2012
? ^^
+ date = Mercredi, 29 août 2012
? ^

======================================================================
FAIL: test_turkish_locale (pelican.tests.test_utils.TestDateFormatter)
----------------------------------------------------------------------
Traceback (most recent call last):
File "github/pelican/pelican/pelican/tests/test_utils.py", line 406, in test_turkish_locale
utils.strftime(self.date, 'date = %A, %d %B %Y'))
AssertionError: 'date = Ã\x87arÅ\x9famba, 29 AÄ\x9fustos 2012' != 'date = Çarşamba, 29 Ağustos 2012'
- date = Ã<87>arÅ<9f>amba, 29 AÄ<9f>ustos 2012
? ^^ ^^ ^^
+ date = Çarşamba, 29 Ağustos 2012
? ^ ^ ^

----------------------------------------------------------------------
Ran 91 tests in 1.819s

FAILED (failures=2, skipped=11)
ERROR: InvocationError: 'github/pelican/pelican/.tox/py33/bin/python -m unittest discover'
_____________________________________________________________ summary ______________________________________________________________
ERROR: py27: commands failed
ERROR: py33: commands failed
```