File: gendoc.py

package info (click to toggle)
ocr4gamera 1.0.6-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 568 kB
  • ctags: 165
  • sloc: python: 871; makefile: 40
file content (47 lines) | stat: -rwxr-xr-x 1,566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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
   # will be documented here, too.
   # If the plugins are not already installed, we'll just ignore
   # them and generate the narrative documentation.
   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"
      print "documentation for the plugins."
      print

   # Step 2:
   # Generate documentation for this toolkit
   # This will handle any commandline arguments if necessary
   gendoc.gendoc(classes=[("gamera.toolkits.ocr.classes",
                           "Textline",
                           "__init__ add_glyph add_glyphs sort_glyphs"),
			  ("gamera.toolkits.ocr.classes",
                           "Page",
                           "__init__ segment page_to_lines order_lines lines_to_chars chars_to_words show_lines show_glyphs show_words"),
			  ("gamera.toolkits.ocr.classes",
                           "ClassifyCCs",
                           "__init__ __call__")],
                 plugins=["PageSegmentation"],
                 sourceforge_logo=False)