Skip to content
Snippets Groups Projects
Commit 71f6fb391904 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

conf2reST.py: Also detect group of modules (like oca)

parent e50b2d9d35fc
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
_logger.info("Odoo version %s", odoo_version) _logger.info("Odoo version %s", odoo_version)
rst = { rst = {
'odoo': {"Odoo": {'version': odoo_version}}, 'odoo': {"Odoo": {'version': odoo_version}},
'tools': {}, 'modules': {}, 'other': {}, 'tools': {}, 'modules': {}, 'other': {}, 'group of modules': {}
} }
# load the conf file # load the conf file
# test if there is a .hgconf file # test if there is a .hgconf file
...@@ -123,9 +123,9 @@ ...@@ -123,9 +123,9 @@
parser = ConfigParser.ConfigParser() parser = ConfigParser.ConfigParser()
parser.read(hgconf_path) parser.read(hgconf_path)
for section in parser.sections(): for section in parser.sections():
if parser.get(section, 'layout') == 'odoo_scripts': layout = parser.get(section, 'layout')
rst['tools']['odoo_scripts'] = { if layout == 'odoo_scripts':
'version': parser.get(section, 'track'), group = 'tools'
'repository': parser.get(section, 'pulluri'), elif any(layout == addon_dir for addon_dir in addon_dirs):
} group = 'group of modules'
elif any( elif any(
...@@ -131,4 +131,3 @@ ...@@ -131,4 +131,3 @@
elif any( elif any(
parser.get(section, 'layout').startswith(dir) layout.startswith(addon_dir) for addon_dir in addon_dirs
for dir in addon_dirs
): ):
...@@ -134,6 +133,3 @@ ...@@ -134,6 +133,3 @@
): ):
rst['modules'][section] = { group = 'modules'
'version': parser.get(section, 'track'),
'repository': parser.get(section, 'pulluri'),
}
else: else:
...@@ -139,8 +135,9 @@ ...@@ -139,8 +135,9 @@
else: else:
rst['other'][section] = { group = 'other'
'version': parser.get(section, 'track'), rst[group][section] = {
'repository': parser.get(section, 'pulluri'), 'version': parser.get(section, 'track'),
} 'repository': parser.get(section, 'pulluri'),
}
# handle nest.yaml case # handle nest.yaml case
confnest_path = os.path.join(directory, 'nest.yaml') confnest_path = os.path.join(directory, 'nest.yaml')
...@@ -150,7 +147,18 @@ ...@@ -150,7 +147,18 @@
data = yaml.safe_load(stream) data = yaml.safe_load(stream)
repos = data['repos'] repos = data['repos']
for module in repos: for module in repos:
rst['modules'][module] = { layout == repos[module]['layout']
if layout == 'odoo_scripts':
group = 'tools'
elif any(layout == addon_dir for addon_dir in addon_dirs):
group = 'group of modules'
elif any(
layout.startswith(addon_dir) for addon_dir in addon_dirs
):
group = 'modules'
else:
group = 'other'
rst[section][module] = {
'version': repos[module]['track'], 'version': repos[module]['track'],
'repository': repos[module]['pulluri'], 'repository': repos[module]['pulluri'],
} }
...@@ -168,7 +176,7 @@ ...@@ -168,7 +176,7 @@
""" """
out.write("Versions\n") out.write("Versions\n")
out.write("========\n\n") out.write("========\n\n")
for group in ('odoo', 'modules', 'other', 'tools'): for group in ('odoo', 'modules', 'group of modules', 'other', 'tools'):
if rst.get(group): if rst.get(group):
out.write(".. list-table:: %s\n" % group) out.write(".. list-table:: %s\n" % group)
out.write(" :widths: 2 3\n") out.write(" :widths: 2 3\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment