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

:ambulance: fix conf2reST

parent 606a967c
No related branches found
No related tags found
2 merge requests!78🚑 fix conf2reST,!77Topic/default/pylint
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
Add new command and flags to run pylint on some modules. Add new command and flags to run pylint on some modules.
Fix conf2reST.
14.0.0 14.0.0
------ ------
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
import yaml import yaml
from .config import Configuration
from .parsing import apply, basic_parser from .parsing import apply, basic_parser
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
...@@ -12,6 +13,6 @@ ...@@ -12,6 +13,6 @@
from .parsing import apply, basic_parser from .parsing import apply, basic_parser
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
__version__ = "1.0.1" __version__ = "1.1.0"
__date__ = "2016-07-15" __date__ = "2016-07-15"
...@@ -17,5 +18,5 @@ ...@@ -17,5 +18,5 @@
__date__ = "2016-07-15" __date__ = "2016-07-15"
__updated__ = "2020-01-28" __updated__ = "2022-01-28"
def main(argv=None): # IGNORE:C0111 def main(argv=None): # IGNORE:C0111
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
program_license = """%s program_license = """%s
Created by Vincent Hatakeyama on %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 Licensed under the MIT License
...@@ -69,11 +70,7 @@ ...@@ -69,11 +70,7 @@
""" """
# read setup.cfg # read setup.cfg
parser = configparser.ConfigParser() c = Configuration(directory)
setup_path = os.path.join(directory, "setup.cfg") addon_dirs = c.addons_path
parser.read(setup_path)
addon_dirs = set(
os.path.dirname(path) for path in parser.get("odoo_scripts", "modules").split()
)
# pip3 freeze # pip3 freeze
...@@ -78,6 +75,6 @@ ...@@ -78,6 +75,6 @@
# pip3 freeze # pip3 freeze
reqs = dict() reqs = {}
pip_freeze = subprocess.check_output(["pip3", "freeze"]) pip_freeze = subprocess.check_output(["pip3", "freeze"])
for element in pip_freeze.split(): for element in pip_freeze.split():
lib_and_version = element.decode("utf-8").split("==") lib_and_version = element.decode("utf-8").split("==")
...@@ -111,7 +108,7 @@ ...@@ -111,7 +108,7 @@
group = "modules" group = "modules"
else: else:
group = "other" group = "other"
rst[group][section] = dict() rst[group][section] = {}
if parser.has_option(section, "track"): if parser.has_option(section, "track"):
rst[group][section]["version"] = parser.get(section, "track") rst[group][section]["version"] = parser.get(section, "track")
if parser.has_option(section, "repository"): if parser.has_option(section, "repository"):
......
...@@ -125,6 +125,9 @@ ...@@ -125,6 +125,9 @@
) )
setattr(self, key, list(set_values)) 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: def key_format(a_key: str) -> str:
"""Replace invalid characters in an attribute""" """Replace invalid characters in an attribute"""
return a_key.replace("-", "_").replace(".", "_") return a_key.replace("-", "_").replace(".", "_")
......
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