Don't crash if pygments is not installed
This commit is contained in:
parent
a20936c7f7
commit
0b871656b5
|
@ -205,6 +205,7 @@ class Index(DynastieGenerator):
|
||||||
break
|
break
|
||||||
|
|
||||||
res = self.createCode(dom, dom.firstChild)
|
res = self.createCode(dom, dom.firstChild)
|
||||||
|
if res:
|
||||||
code = code.replace(code[start:end+11], res)
|
code = code.replace(code[start:end+11], res)
|
||||||
|
|
||||||
return code
|
return code
|
||||||
|
@ -379,7 +380,7 @@ class Index(DynastieGenerator):
|
||||||
from pygments.formatters import get_formatter_by_name
|
from pygments.formatters import get_formatter_by_name
|
||||||
except ImportError:
|
except ImportError:
|
||||||
self.addError('Pygments package is missing, please install it in order to use <dyn:code>')
|
self.addError('Pygments package is missing, please install it in order to use <dyn:code>')
|
||||||
return
|
return None
|
||||||
|
|
||||||
language = node.getAttribute('language')
|
language = node.getAttribute('language')
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ljdc>
|
<ljdc>
|
||||||
|
<entry>
|
||||||
|
<id>124083117265</id>
|
||||||
|
<address>http://thecodinglove.com/post/124083117265/git-push-force</address>
|
||||||
|
<title>Git push --force</title>
|
||||||
|
<img>http://tclhost.com/cMusPk2.gif</img>
|
||||||
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>117591456984</id>
|
<id>117591456984</id>
|
||||||
<address>http://lesjoiesducode.fr/post/117591456984/quand-le-nouveau-essaie-de-suivre-le-dialogue</address>
|
<address>http://lesjoiesducode.fr/post/117591456984/quand-le-nouveau-essaie-de-suivre-le-dialogue</address>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user