File: fix-version-import-in-docs.patch

package info (click to toggle)
python-django-mptt 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 512 kB
  • sloc: python: 1,937; makefile: 119; sh: 3
file content (16 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Fix version import in docs
 The script can not import mptt module because it is not in python path during
 the documentation build, so we append sub directory to sys.path
Author: Janos Guljas <janos@resenje.org>
Last-Update: 2011-01-25

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,6 +48,7 @@ copyright = u'2007 - 2010, Jonathan Buch
 # built documents.
 #
 # The short X.Y version.
+sys.path.append(os.path.realpath(os.sep.join(os.path.dirname(__file__).split(os.sep)[:-1])))
 version_tuple = __import__('mptt').VERSION
 version = ".".join([str(v) for v in version_tuple])