Skip to content

Commit

Permalink
Renaming function
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Apr 15, 2016
1 parent b067c5e commit 84a40ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pandoc_listof.py
Expand Up @@ -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:
Expand All @@ -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<version>.*)', out).group('version').decode('utf-8')
return pandoc_version.version
pandocVersion.value = re.search(b'pandoc (?P<version>.*)', out).group('version').decode('utf-8')
return pandocVersion.value


def main():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_listof.py
Expand Up @@ -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)
Expand Down

0 comments on commit 84a40ee

Please sign in to comment.