Description: Allow to build documentation from local source.
 Normally it's only possible to build documentation is the toolkit is
 installed system-wide. This patch allows the documentation to be built from
 local source.
 .
 Also, abort if importing the toolkit didn't succeed.
Author: Jakub Wilk <jwilk@debian.org>
Forwarded: not-needed
Last-Update: 2012-02-13

--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -1,8 +1,20 @@
 #!/usr/bin/env python
 
+import os
+import sys
+
 from gamera import gendoc
 
 if __name__ == '__main__':
+
+   import gamera.toolkits
+   gamera.toolkits.__path__[:0] = [os.path.join(
+      sys.path[0],
+      os.pardir,
+      'gamera',
+      'toolkits'
+   )]
+
    # Step 1:
    # Import all of the plugins to document.
    # Be careful not to load the core plugins, or they
@@ -12,6 +24,7 @@
    try:
       from gamera.toolkits.ocr.plugins import bbox_merging_mcmillan
    except ImportError:
+      raise
       print "WARNING:"
       print "This `ocr` toolkit must be installed before generating"
       print "the documentation.  For now, the system will skip generating"
