# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1643378081 -3600
#      Fri Jan 28 14:54:41 2022 +0100
# Node ID 3636e61725fac7f4ec5a537993dc0df5021e2e62
# Parent  606a967c39b15e0a3d167619fb472e374ba176f9
🚑 fix conf2reST

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,8 @@
 
 Add new command and flags to run pylint on some modules.
 
+Fix conf2reST.
+
 14.0.0
 ------
 
diff --git a/odoo_scripts/conf2reST.py b/odoo_scripts/conf2reST.py
--- a/odoo_scripts/conf2reST.py
+++ b/odoo_scripts/conf2reST.py
@@ -9,13 +9,14 @@
 
 import yaml
 
+from .config import Configuration
 from .parsing import apply, basic_parser
 
 _logger = logging.getLogger(__name__)
 
-__version__ = "1.0.1"
+__version__ = "1.1.0"
 __date__ = "2016-07-15"
-__updated__ = "2020-01-28"
+__updated__ = "2022-01-28"
 
 
 def main(argv=None):  # IGNORE:C0111
@@ -35,7 +36,7 @@
     program_license = """%s
 
   Created by Vincent Hatakeyama on %s.
-  Copyright 2016, 2019, 2020 XCG Consulting. All rights reserved.
+  Copyright 2016, 2019, 2020, 2022 XCG Consulting. All rights reserved.
 
   Licensed under the MIT License
 
@@ -69,15 +70,11 @@
     """
 
     # read setup.cfg
-    parser = configparser.ConfigParser()
-    setup_path = os.path.join(directory, "setup.cfg")
-    parser.read(setup_path)
-    addon_dirs = set(
-        os.path.dirname(path) for path in parser.get("odoo_scripts", "modules").split()
-    )
+    c = Configuration(directory)
+    addon_dirs = c.addons_path
 
     # pip3 freeze
-    reqs = dict()
+    reqs = {}
     pip_freeze = subprocess.check_output(["pip3", "freeze"])
     for element in pip_freeze.split():
         lib_and_version = element.decode("utf-8").split("==")
@@ -111,7 +108,7 @@
                 group = "modules"
             else:
                 group = "other"
-            rst[group][section] = dict()
+            rst[group][section] = {}
             if parser.has_option(section, "track"):
                 rst[group][section]["version"] = parser.get(section, "track")
             if parser.has_option(section, "repository"):
diff --git a/odoo_scripts/config.py b/odoo_scripts/config.py
--- a/odoo_scripts/config.py
+++ b/odoo_scripts/config.py
@@ -125,6 +125,9 @@
                 )
             setattr(self, key, list(set_values))
 
+        self.addons_path = {os.path.dirname(module) for module in self.modules}
+        """Set of directory containing modules"""
+
         def key_format(a_key: str) -> str:
             """Replace invalid characters in an attribute"""
             return a_key.replace("-", "_").replace(".", "_")