summaryrefslogtreecommitdiff
path: root/doc/source/conf.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-01-15 15:22:12 +0100
committerJulian Andres Klode <jak@debian.org>2010-01-15 15:22:12 +0100
commit7bfefb84523645fe24d0e5603d56c23cf410328e (patch)
tree3965ce6e2e968a2facd5efa2e3ea4fb34c4140ff /doc/source/conf.py
parent71aad7e28bbaf1ee8efdad77ebfb4e4c0fd0ec26 (diff)
parent52cca77b8179a7f625673f19cb132686c0d416c9 (diff)
downloadpython-apt-7bfefb84523645fe24d0e5603d56c23cf410328e.tar.gz
Merge debian-experimental.
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r--doc/source/conf.py53
1 files changed, 39 insertions, 14 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 40154a6f..0a9d5ed5 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -16,6 +16,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
+import glob
import sys
# If your extensions are in another directory, add it here. If the directory
@@ -27,9 +28,21 @@ sys.path.insert(0, os.path.abspath('../..'))
# Find the path to the built apt_pkg and apt_inst extensions
if os.path.exists("../../build"):
version = '.'.join(str(x) for x in sys.version_info[:2])
- for dirname in os.listdir('../../build'):
- if version in dirname:
- sys.path.insert(0, os.path.abspath('../../build/' + dirname))
+ for apt_pkg_path in glob.glob('../../build/lib*%s/apt_pkg.so' % version):
+ sys.path.insert(0, os.path.dirname(apt_pkg_path))
+ try:
+ import apt_pkg
+ except ImportError, exc:
+ # Not the correct version
+ sys.stderr.write('W: Ignoring error %s\n' % exc)
+ sys.path.pop(0)
+ else:
+ sys.stdout.write('I: Found apt_pkg.so in %s\n' % sys.path[0])
+ # Hack: Disable compatibility mode
+ apt_pkg._COMPAT_0_7 = 0
+ break
+
+
# General configuration
# ---------------------
@@ -41,7 +54,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
intersphinx_mapping = {'http://docs.python.org/': None}
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['.templates']
+templates_path = ['templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -50,7 +63,7 @@ source_suffix = '.rst'
#source_encoding = 'utf-8'
# The master toctree document.
-master_doc = 'index'
+#master_doc = 'contents'
# General information about the project.
project = u'python-apt'
@@ -60,13 +73,25 @@ copyright = u'2009, Julian Andres Klode <jak@debian.org>'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-from debian_bundle.changelog import Changelog
-changes = Changelog(open('../../debian/changelog'))
-# The short X.Y version.
-version = '.'.join(changes.full_version.split('.')[:2])
-# The full version, including alpha/beta/rc tags.
-release = changes.full_version
+try:
+ release=os.environ['DEBVER']
+except KeyError:
+ from subprocess import Popen, PIPE
+ p1 = Popen(["dpkg-parsechangelog", "-l../../debian/changelog"],
+ stdout=PIPE)
+ p2 = Popen(["sed", "-n", 's/^Version: //p'], stdin=p1.stdout, stdout=PIPE)
+ release = p2.communicate()[0]
+
+# Handle the alpha release scheme.
+if int(release.split("~")[0].split(".")[2]) >= 90:
+ version_s = release.split("~")[0].split(".")[:3]
+ version_s[1] = str(int(version_s[1]) + 1)
+ version_s[2] = "0"
+ version = '.'.join(version_s)
+ del version_s
+else:
+ version = '.'.join(release.split("~")[0].split('.')[:3])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -134,7 +159,7 @@ html_static_path = ['.static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
+html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
@@ -145,7 +170,7 @@ html_static_path = ['.static']
# Additional templates that should be rendered to pages, maps page names to
# template names.
-#html_additional_pages = {}
+html_additional_pages = {"index": "indexcontent.html"}
# If false, no module index is generated.
#html_use_modindex = True
@@ -183,7 +208,7 @@ htmlhelp_basename = 'python-aptdoc'
# Grouping the document tree into LaTeX files. List of tuples
# (source index, target name, title, author, document class [howto/manual]).
latex_documents = [
- ('index', 'python-apt.tex', ur'python-apt Documentation',
+ ('contents', 'python-apt.tex', ur'python-apt Documentation',
ur'Julian Andres Klode <jak@debian.org>', 'manual'),
]