| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# |
| 3 |
# OdooRPC documentation build configuration file, created by |
| 4 |
# sphinx-quickstart on Sun Jul 6 16:32:50 2014. |
| 5 |
# |
| 6 |
# This file is execfile()d with the current directory set to its |
| 7 |
# containing dir. |
| 8 |
# |
| 9 |
# Note that not all possible configuration values are present in this |
| 10 |
# autogenerated file. |
| 11 |
# |
| 12 |
# All configuration values have a default; values that are commented out |
| 13 |
# serve to show the default. |
| 14 |
|
| 15 |
import os |
| 16 |
import sys |
| 17 |
from datetime import datetime |
| 18 |
|
| 19 |
# If extensions (or modules to document with autodoc) are in another directory, |
| 20 |
# add these directories to sys.path here. If the directory is relative to the |
| 21 |
# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 22 |
#sys.path.insert(0, os.path.abspath('.')) |
| 23 |
sys.path.insert(0, os.path.abspath('./../..')) # To find 'sphinx_ext' package |
| 24 |
|
| 25 |
# -- General configuration ------------------------------------------------ |
| 26 |
|
| 27 |
# If your documentation needs a minimal Sphinx version, state it here. |
| 28 |
#needs_sphinx = '1.0' |
| 29 |
|
| 30 |
# Add any Sphinx extension module names here, as strings. They can be |
| 31 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 32 |
# ones. |
| 33 |
extensions = [ |
| 34 |
'sphinx.ext.autodoc', |
| 35 |
'sphinx_ext.doctest_custom', |
| 36 |
] |
| 37 |
doctest_global_setup = """ |
| 38 |
import os |
| 39 |
PROTOCOL = os.environ.get('ORPC_TEST_PROTOCOL', 'jsonrpc') |
| 40 |
HOST = os.environ.get('ORPC_TEST_HOST', 'localhost') |
| 41 |
PORT = os.environ.get('ORPC_TEST_PORT', 8069) |
| 42 |
DB = os.environ.get('ORPC_TEST_DB', 'odoorpc_doctest') |
| 43 |
USER = os.environ.get('ORPC_TEST_USER', 'admin') |
| 44 |
PWD = os.environ.get('ORPC_TEST_PWD', 'admin') |
| 45 |
VERSION = os.environ.get('ORPC_TEST_VERSION', '10.0') |
| 46 |
SUPER_PWD = os.environ.get('ORPC_TEST_SUPER_PWD', 'admin') |
| 47 |
import odoorpc |
| 48 |
from odoorpc.tools import v |
| 49 |
odoo = odoorpc.ODOO(HOST, protocol=PROTOCOL, port=PORT, version=VERSION) |
| 50 |
# == create a database |
| 51 |
if DB not in odoo.db.list(): |
| 52 |
odoo.db.create(SUPER_PWD, DB, True) |
| 53 |
odoo.login(DB, USER, PWD) |
| 54 |
# == install fr_FR language |
| 55 |
Wizard = odoo.env['base.language.install'] |
| 56 |
lang_code = 'fr_FR' |
| 57 |
if v(odoo.version)[0] >= 16: |
| 58 |
lang_ids = odoo.env['res.lang'].with_context(active_test=False).search( |
| 59 |
[('code', '=', lang_code)] |
| 60 |
) |
| 61 |
values = {'lang_ids': [(6, 0, lang_ids)]} |
| 62 |
else: |
| 63 |
values = {'lang': lang_code} |
| 64 |
wiz_id = Wizard.create(values) |
| 65 |
Wizard.lang_install([wiz_id]) |
| 66 |
# == install some modules |
| 67 |
odoo.config['timeout'] = 600 |
| 68 |
Module = odoo.env['ir.module.module'] |
| 69 |
module_ids = Module.search([('name', 'in', ['sale', 'crm']), ('state', '=', 'uninstalled')]) |
| 70 |
if module_ids: |
| 71 |
Module.button_immediate_install(module_ids) |
| 72 |
odoo.config['timeout'] = 120 |
| 73 |
""" |
| 74 |
|
| 75 |
# Add any paths that contain templates here, relative to this directory. |
| 76 |
templates_path = ['_templates'] |
| 77 |
|
| 78 |
# The suffix of source filenames. |
| 79 |
source_suffix = '.rst' |
| 80 |
|
| 81 |
# The encoding of source files. |
| 82 |
#source_encoding = 'utf-8-sig' |
| 83 |
|
| 84 |
# The master toctree document. |
| 85 |
master_doc = 'index' |
| 86 |
|
| 87 |
# General information about the project. |
| 88 |
project = u'OdooRPC' |
| 89 |
copyright = u'2014-{0}, Sébastien Alix'.format(datetime.now().year) |
| 90 |
|
| 91 |
# The version info for the project you're documenting, acts as replacement for |
| 92 |
# |version| and |release|, also used in various other places throughout the |
| 93 |
# built documents. |
| 94 |
# |
| 95 |
# The short X.Y version. |
| 96 |
version = '0.10.1' |
| 97 |
# The full version, including alpha/beta/rc tags. |
| 98 |
release = '0.10.1' |
| 99 |
|
| 100 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 101 |
# for a list of supported languages. |
| 102 |
#language = None |
| 103 |
|
| 104 |
# There are two options for replacing |today|: either, you set today to some |
| 105 |
# non-false value, then it is used: |
| 106 |
#today = '' |
| 107 |
# Else, today_fmt is used as the format for a strftime call. |
| 108 |
#today_fmt = '%B %d, %Y' |
| 109 |
|
| 110 |
# List of patterns, relative to source directory, that match files and |
| 111 |
# directories to ignore when looking for source files. |
| 112 |
exclude_patterns = ['build'] |
| 113 |
|
| 114 |
# The reST default role (used for this markup: `text`) to use for all |
| 115 |
# documents. |
| 116 |
#default_role = None |
| 117 |
|
| 118 |
# If true, '()' will be appended to :func: etc. cross-reference text. |
| 119 |
#add_function_parentheses = True |
| 120 |
|
| 121 |
# If true, the current module name will be prepended to all description |
| 122 |
# unit titles (such as .. function::). |
| 123 |
#add_module_names = True |
| 124 |
|
| 125 |
# If true, sectionauthor and moduleauthor directives will be shown in the |
| 126 |
# output. They are ignored by default. |
| 127 |
#show_authors = False |
| 128 |
|
| 129 |
# The name of the Pygments (syntax highlighting) style to use. |
| 130 |
pygments_style = 'sphinx' |
| 131 |
|
| 132 |
# A list of ignored prefixes for module index sorting. |
| 133 |
#modindex_common_prefix = [] |
| 134 |
|
| 135 |
# If true, keep warnings as "system message" paragraphs in the built documents. |
| 136 |
#keep_warnings = False |
| 137 |
|
| 138 |
|
| 139 |
# -- Options for HTML output ---------------------------------------------- |
| 140 |
|
| 141 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 142 |
# a list of builtin themes. |
| 143 |
html_theme = 'nature' |
| 144 |
html_style = 'odoorpc.css' |
| 145 |
|
| 146 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 147 |
# further. For a list of options available for each theme, see the |
| 148 |
# documentation. |
| 149 |
#html_theme_options = {} |
| 150 |
|
| 151 |
# Add any paths that contain custom themes here, relative to this directory. |
| 152 |
#html_theme_path = [] |
| 153 |
|
| 154 |
# The name for this set of Sphinx documents. If None, it defaults to |
| 155 |
# "<project> v<release> documentation". |
| 156 |
#html_title = None |
| 157 |
|
| 158 |
# A shorter title for the navigation bar. Default is the same as html_title. |
| 159 |
#html_short_title = None |
| 160 |
|
| 161 |
# The name of an image file (relative to this directory) to place at the top |
| 162 |
# of the sidebar. |
| 163 |
html_logo = '_static/logo.png' |
| 164 |
|
| 165 |
# The name of an image file (within the static path) to use as favicon of the |
| 166 |
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 167 |
# pixels large. |
| 168 |
#html_favicon = None |
| 169 |
|
| 170 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 171 |
# relative to this directory. They are copied after the builtin static files, |
| 172 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 173 |
html_static_path = ['_static'] |
| 174 |
|
| 175 |
# Add any extra paths that contain custom files (such as robots.txt or |
| 176 |
# .htaccess) here, relative to this directory. These files are copied |
| 177 |
# directly to the root of the documentation. |
| 178 |
#html_extra_path = [] |
| 179 |
|
| 180 |
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 181 |
# using the given strftime format. |
| 182 |
#html_last_updated_fmt = '%b %d, %Y' |
| 183 |
|
| 184 |
# If true, SmartyPants will be used to convert quotes and dashes to |
| 185 |
# typographically correct entities. |
| 186 |
#html_use_smartypants = True |
| 187 |
|
| 188 |
# Custom sidebar templates, maps document names to template names. |
| 189 |
#html_sidebars = {} |
| 190 |
|
| 191 |
# Additional templates that should be rendered to pages, maps page names to |
| 192 |
# template names. |
| 193 |
#html_additional_pages = {} |
| 194 |
|
| 195 |
# If false, no module index is generated. |
| 196 |
#html_domain_indices = True |
| 197 |
|
| 198 |
# If false, no index is generated. |
| 199 |
#html_use_index = True |
| 200 |
|
| 201 |
# If true, the index is split into individual pages for each letter. |
| 202 |
#html_split_index = False |
| 203 |
|
| 204 |
# If true, links to the reST sources are added to the pages. |
| 205 |
#html_show_sourcelink = True |
| 206 |
|
| 207 |
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
| 208 |
#html_show_sphinx = True |
| 209 |
|
| 210 |
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
| 211 |
#html_show_copyright = True |
| 212 |
|
| 213 |
# If true, an OpenSearch description file will be output, and all pages will |
| 214 |
# contain a <link> tag referring to it. The value of this option must be the |
| 215 |
# base URL from which the finished HTML is served. |
| 216 |
#html_use_opensearch = '' |
| 217 |
|
| 218 |
# This is the file name suffix for HTML files (e.g. ".xhtml"). |
| 219 |
#html_file_suffix = None |
| 220 |
|
| 221 |
# Output file base name for HTML help builder. |
| 222 |
htmlhelp_basename = 'OdooRPCdoc' |
| 223 |
|
| 224 |
|
| 225 |
# -- Options for LaTeX output --------------------------------------------- |
| 226 |
|
| 227 |
latex_elements = { |
| 228 |
# The paper size ('letterpaper' or 'a4paper'). |
| 229 |
#'papersize': 'letterpaper', |
| 230 |
|
| 231 |
# The font size ('10pt', '11pt' or '12pt'). |
| 232 |
#'pointsize': '10pt', |
| 233 |
|
| 234 |
# Additional stuff for the LaTeX preamble. |
| 235 |
#'preamble': '', |
| 236 |
} |
| 237 |
|
| 238 |
# Grouping the document tree into LaTeX files. List of tuples |
| 239 |
# (source start file, target name, title, |
| 240 |
# author, documentclass [howto, manual, or own class]). |
| 241 |
latex_documents = [ |
| 242 |
('index', 'OdooRPC.tex', u'OdooRPC Documentation', |
| 243 |
u'Sébastien Alix', 'manual'), |
| 244 |
] |
| 245 |
|
| 246 |
# The name of an image file (relative to this directory) to place at the top of |
| 247 |
# the title page. |
| 248 |
#latex_logo = None |
| 249 |
|
| 250 |
# For "manual" documents, if this is true, then toplevel headings are parts, |
| 251 |
# not chapters. |
| 252 |
#latex_use_parts = False |
| 253 |
|
| 254 |
# If true, show page references after internal links. |
| 255 |
#latex_show_pagerefs = False |
| 256 |
|
| 257 |
# If true, show URL addresses after external links. |
| 258 |
#latex_show_urls = False |
| 259 |
|
| 260 |
# Documents to append as an appendix to all manuals. |
| 261 |
#latex_appendices = [] |
| 262 |
|
| 263 |
# If false, no module index is generated. |
| 264 |
#latex_domain_indices = True |
| 265 |
|
| 266 |
|
| 267 |
# -- Options for manual page output --------------------------------------- |
| 268 |
|
| 269 |
# One entry per manual page. List of tuples |
| 270 |
# (source start file, name, description, authors, manual section). |
| 271 |
man_pages = [ |
| 272 |
('index', 'odoorpc', u'OdooRPC Documentation', |
| 273 |
[u'Sébastien Alix'], 1) |
| 274 |
] |
| 275 |
|
| 276 |
# If true, show URL addresses after external links. |
| 277 |
#man_show_urls = False |
| 278 |
|
| 279 |
|
| 280 |
# -- Options for Texinfo output ------------------------------------------- |
| 281 |
|
| 282 |
# Grouping the document tree into Texinfo files. List of tuples |
| 283 |
# (source start file, target name, title, author, |
| 284 |
# dir menu entry, description, category) |
| 285 |
texinfo_documents = [ |
| 286 |
('index', 'OdooRPC', u'OdooRPC Documentation', |
| 287 |
u'Sébastien Alix', 'OdooRPC', 'One line description of project.', |
| 288 |
'Miscellaneous'), |
| 289 |
] |
| 290 |
|
| 291 |
# Documents to append as an appendix to all manuals. |
| 292 |
#texinfo_appendices = [] |
| 293 |
|
| 294 |
# If false, no module index is generated. |
| 295 |
#texinfo_domain_indices = True |
| 296 |
|
| 297 |
# How to display URL addresses: 'footnote', 'no', or 'inline'. |
| 298 |
#texinfo_show_urls = 'footnote' |
| 299 |
|
| 300 |
# If true, do not generate a @detailmenu in the "Top" node's menu. |
| 301 |
#texinfo_no_detailmenu = False |