From 84a40eef131771bce0f391228f27460f76e34a4d Mon Sep 17 00:00:00 2001 From: Christophe Demko Date: Fri, 15 Apr 2016 16:47:52 +0200 Subject: [PATCH] Renaming function --- pandoc_listof.py | 10 +++++----- tests/test_listof.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandoc_listof.py b/pandoc_listof.py index a3d18fc..cc9243f 100644 --- a/pandoc_listof.py +++ b/pandoc_listof.py @@ -162,7 +162,7 @@ def listof(key, value, format, meta): for value in collections[name]: # Add an item to the list - if pandoc_version() < '1.16': + if pandocVersion() < '1.16': # pandoc 1.15 link = Link([Str(value['text'])], ['#' + prefix + ':' + value['identifier'], '']) else: @@ -178,12 +178,12 @@ def listof(key, value, format, meta): elif re.match('^{{[a-zA-Z][\w.-]*}$', value[0]['c']): value[0]['c'] = value[0]['c'][1:] -def pandoc_version(): - if not hasattr(pandoc_version, "version"): +def pandocVersion(): + if not hasattr(pandocVersion, 'value'): p = subprocess.Popen(['pandoc', '-v'], stdout=subprocess.PIPE,stderr=subprocess.PIPE) out, err = p.communicate() - pandoc_version.version = re.search(b'pandoc (?P.*)', out).group('version').decode('utf-8') - return pandoc_version.version + pandocVersion.value = re.search(b'pandoc (?P.*)', out).group('version').decode('utf-8') + return pandocVersion.value def main(): diff --git a/tests/test_listof.py b/tests/test_listof.py index 3bbba2f..9f5e679 100644 --- a/tests/test_listof.py +++ b/tests/test_listof.py @@ -10,7 +10,7 @@ def init(): pandoc_listof.headers = [0, 0, 0, 0, 0, 0] def createLink(attributes, text, reference_title): - if pandoc_listof.pandoc_version() < '1.16': + if pandoc_listof.pandocVersion() < '1.16': return Link(text, reference_title) else: return Link(attributes, text, reference_title)