src/source/conf.py
changeset 46 5fe8d5ffccde
parent 45 918d3c9b53ee
child 48 ca7d05086e67
equal deleted inserted replaced
28:a7332a53e6dc 46:5fe8d5ffccde
    15 
    15 
    16 # If extensions (or modules to document with autodoc) are in another directory,
    16 # If extensions (or modules to document with autodoc) are in another directory,
    17 # add these directories to sys.path here. If the directory is relative to the
    17 # add these directories to sys.path here. If the directory is relative to the
    18 # documentation root, use os.path.abspath to make it absolute, like shown here.
    18 # documentation root, use os.path.abspath to make it absolute, like shown here.
    19 #
    19 #
    20 # import sys
    20 import sys
    21 # sys.path.insert(0, '/var/local/env/pycharm/lib/python3.5/site-packages')
    21 #sys.path.insert(0, '/var/local/env/pycharm/lib/python3.5/site-packages')
       
    22 
       
    23 import os
       
    24 
       
    25 prefix_path = os.path.abspath('../../../') + os.path.sep
       
    26 sys.path[0:0] = list(map(lambda x: prefix_path + x,
       
    27                          [
       
    28                              'pyams_alchemy/src',
       
    29                              'pyams_cache/src',
       
    30                              'pyams_catalog/src',
       
    31                              'pyams_content/src',
       
    32                              'pyams_content_es/src',
       
    33                              'pyams_default_theme/src',
       
    34                              'pyams_file/src',
       
    35                              'pyams_form/src',
       
    36                              'pyams_gis/src',
       
    37                              'pyams_i18n/src',
       
    38                              'pyams_ldap/src',
       
    39                              'pyams_mail/src',
       
    40                              'pyams_media/src',
       
    41                              'pyams_notify/src',
       
    42                              'pyams_notify_ws/src',
       
    43                              'pyams_pagelet/src',
       
    44                              'pyams_portal/src',
       
    45                              'pyams_scheduler/src',
       
    46                              'pyams_security/src',
       
    47                              'pyams_sequence/src',
       
    48                              'pyams_skin/src',
       
    49                              'pyams_template/src',
       
    50                              'pyams_thesaurus/src',
       
    51                              'pyams_utils/src',
       
    52                              'pyams_viewlet/src',
       
    53                              'pyams_workflow/src',
       
    54                              'pyams_zmi/src',
       
    55                              'pyams_zmq/src',
       
    56                              'pyams_zodbbrowser/src',
       
    57                          ])
       
    58                      )
    22 
    59 
    23 # -- General configuration ------------------------------------------------
    60 # -- General configuration ------------------------------------------------
    24 
    61 
    25 # If your documentation needs a minimal Sphinx version, state it here.
    62 # If your documentation needs a minimal Sphinx version, state it here.
    26 #
    63 #
    29 # Add any Sphinx extension module names here, as strings. They can be
    66 # Add any Sphinx extension module names here, as strings. They can be
    30 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
    67 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
    31 # ones.
    68 # ones.
    32 extensions = [
    69 extensions = [
    33     'sphinx.ext.autodoc',
    70     'sphinx.ext.autodoc',
       
    71     'sphinx.ext.todo',
       
    72     'sphinx.ext.coverage',
       
    73     'sphinx.ext.viewcode'
    34 ]
    74 ]
    35 
    75 
    36 # Add any paths that contain templates here, relative to this directory.
    76 # Add any paths that contain templates here, relative to this directory.
    37 templates_path = ['_templates']
    77 templates_path = ['_templates']
    38 
    78 
   179 
   219 
   180 # A list of files that should not be packed into the epub file.
   220 # A list of files that should not be packed into the epub file.
   181 epub_exclude_files = ['search.html']
   221 epub_exclude_files = ['search.html']
   182 
   222 
   183 
   223 
       
   224 try:
       
   225     from zope.schema.fieldproperty import FieldProperty
       
   226 except ImportError:
       
   227     raise
       
   228 else:
       
   229     def get_field_doc(self):
       
   230         field = self._FieldProperty__field
       
   231         if field.title and field.description:
       
   232             return '{0}: {1}'.format(field.title, field.description)
       
   233         elif field.title:
       
   234             return field.title
       
   235         else:
       
   236             return super(self.__class__, self).__doc__
       
   237     FieldProperty.__doc__ = property(get_field_doc)