Skip to content

Commit

Permalink
remove usage of git inside sphinx configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Feb 10, 2015
1 parent 6d9e3eb commit 7c2682f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import sys
import subprocess
import time
from xml.etree.ElementTree import ElementTree

# -- General configuration -----------------------------------------------------
Expand Down Expand Up @@ -47,23 +48,17 @@

# General information about the project.
project = u'catkin'
gitcmd = 'git log -n1 --pretty=format:%cD'.split()

lastmod = subprocess.Popen(gitcmd, stdout=subprocess.PIPE).communicate()[0]
dochash = subprocess.Popen('git log -n1 --pretty=format:%H'.split(),
stdout=subprocess.PIPE).communicate()[0]

print "dochash=", dochash
copyright = u'2010, Willow Garage -- ' + ' Version ' + dochash + ", " + ' '.join(lastmod.split(' ')[:4])

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
try:
root = ElementTree(None, os.path.join('..', 'package.xml'))
version = root.findtext('version')
author_names = [a.text for a in root.findall('author')]
copyright = u'2010-%s, %s' % (time.strftime('%Y'), ', '.join(author_names))
except Exception as e:
raise RuntimeError('Could not extract version from package.xml:\n%s' % e)
raise RuntimeError('Could not extract version and authors from package.xml:\n%s' % e)

# The full version, including alpha/beta/rc tags.
release = version
Expand Down

0 comments on commit 7c2682f

Please sign in to comment.