2026-07-22 20:03:17 -04:00
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
|
|
|
|
|
|
|
|
|
modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/'
|
|
|
|
|
trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_info():
|
|
|
|
|
import configparser
|
|
|
|
|
import os
|
2026-08-14 17:07:58 -04:00
|
|
|
import tomllib
|
2026-07-22 20:03:17 -04:00
|
|
|
|
|
|
|
|
module_dir = os.path.dirname(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
|
config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
|
|
|
|
|
info = dict(config.items('tryton'))
|
|
|
|
|
|
2026-08-14 17:07:58 -04:00
|
|
|
with open(os.path.join(module_dir, 'pyproject.toml'), 'rb') as stream:
|
|
|
|
|
project = tomllib.load(stream)['project']
|
|
|
|
|
info['name'] = project['name']
|
2026-07-22 20:03:17 -04:00
|
|
|
|
2026-08-14 17:07:58 -04:00
|
|
|
version = info['version']
|
2026-07-22 20:03:17 -04:00
|
|
|
if 'dev' in version:
|
|
|
|
|
info['series'] = 'latest'
|
|
|
|
|
else:
|
|
|
|
|
info['series'] = '.'.join(version.split('.', 2)[:2])
|
|
|
|
|
|
|
|
|
|
for key in {'depends', 'extras_depend'}:
|
|
|
|
|
info[key] = info.get(key, '').strip().splitlines()
|
|
|
|
|
info['modules'] = set(info['depends'] + info['extras_depend'])
|
|
|
|
|
info['modules'] -= {'ir', 'res'}
|
|
|
|
|
|
|
|
|
|
return info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = get_info()
|
|
|
|
|
|
|
|
|
|
master_doc = 'index'
|
|
|
|
|
project = info['name']
|
|
|
|
|
release = version = info['series']
|
|
|
|
|
default_role = 'ref'
|
|
|
|
|
highlight_language = 'none'
|
|
|
|
|
extensions = [
|
|
|
|
|
'sphinx.ext.intersphinx',
|
|
|
|
|
]
|
|
|
|
|
intersphinx_mapping = {
|
|
|
|
|
'trytond': (trytond_url.format(series=version), None),
|
|
|
|
|
}
|
|
|
|
|
intersphinx_mapping.update({
|
|
|
|
|
m: (modules_url.format(
|
|
|
|
|
module=m.replace('_', '-'), series=version), None)
|
|
|
|
|
for m in info['modules']
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
del get_info, info, modules_url, trytond_url
|