##// END OF EJS Templates
A couple more small changes,...
Jonathan Frederic -
Show More
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -1,6 +1,6 b''
1 """Utility for calling pandoc"""
1 """Utility for calling pandoc"""
2 #-----------------------------------------------------------------------------
2 #-----------------------------------------------------------------------------
3 # Copyright (c) 2013 the IPython Development Team.
3 # Copyright (c) 2014 the IPython Development Team.
4 #
4 #
5 # Distributed under the terms of the Modified BSD License.
5 # Distributed under the terms of the Modified BSD License.
6 #
6 #
@@ -10,7 +10,6 b''
10 #-----------------------------------------------------------------------------
10 #-----------------------------------------------------------------------------
11 # Imports
11 # Imports
12 #-----------------------------------------------------------------------------
12 #-----------------------------------------------------------------------------
13
14 from __future__ import print_function
13 from __future__ import print_function
15
14
16 # Stdlib imports
15 # Stdlib imports
@@ -24,7 +23,6 b' from IPython.utils.py3compat import cast_bytes'
24 from IPython.utils.version import check_version
23 from IPython.utils.version import check_version
25 from IPython.utils.process import is_cmd_found, FindCmdError
24 from IPython.utils.process import is_cmd_found, FindCmdError
26
25
27
28 from .exceptions import ConversionException
26 from .exceptions import ConversionException
29
27
30 #-----------------------------------------------------------------------------
28 #-----------------------------------------------------------------------------
@@ -84,16 +82,14 b' def get_pandoc_version():'
84 """
82 """
85 global __version
83 global __version
86
84
87 if __version is not None:
85 if __version is None:
88 return __version
89 else:
90 if not is_cmd_found('pandoc'):
86 if not is_cmd_found('pandoc'):
91 raise PandocMissing()
87 raise PandocMissing()
92
88
93 out = subprocess.check_output( ['pandoc', '-v'], universal_newlines=True)
89 out = subprocess.check_output( ['pandoc', '-v'], universal_newlines=True)
94 pv_re = re.compile(r'(\d{0,3}\.\d{0,3}\.\d{0,3})')
90 pv_re = re.compile(r'(\d{0,3}\.\d{0,3}\.\d{0,3})')
95 __version = pv_re.search(out).group(0)
91 __version = pv_re.search(out).group(0)
96 return __version
92 return __version
97
93
98
94
99 def check_pandoc_version():
95 def check_pandoc_version():
@@ -130,6 +126,3 b' def clean_cache():'
130 __version = None
126 __version = None
131
127
132 __version = None
128 __version = None
133
134
135
@@ -1,5 +1,4 b''
1 """Test Pandoc module"""
1 """Test Pandoc module"""
2
3 #-----------------------------------------------------------------------------
2 #-----------------------------------------------------------------------------
4 # Copyright (C) 2014 The IPython Development Team
3 # Copyright (C) 2014 The IPython Development Team
5 #
4 #
General Comments 0
You need to be logged in to leave comments. Login now