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

:ambulance: fix list_modules

parent a27dd12a6cf7
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
"""Create the file odoo_modules_list from setup.cfg
"""
# vim: set shiftwidth=4 softtabstop=4:
......@@ -2,10 +4,8 @@
# vim: set shiftwidth=4 softtabstop=4:
# Create the file odoo_modules_list from setup.cfg
#
# template version 2.7
import argparse
import configparser
import logging
import os
......@@ -6,9 +6,8 @@
# template version 2.7
import argparse
import configparser
import logging
import os
import subprocess
import sys
......@@ -13,7 +12,5 @@
import sys
import yaml
from .logging import add_verbosity_to_parser, logging_from_verbose
_logger = logging.getLogger(__name__)
......@@ -62,5 +59,6 @@
nmspc = parser.parse_args()
logging_from_verbose(nmspc)
list_modules(nmspc.directory, nmspc.output)
list_modules()
......@@ -66,9 +64,9 @@
def list_modules():
c = configparser.ConfigParser()
c.read(os.getcwd()+'/setup.cfg')
with open('odoo_modules_list') as odoo_modul_list:
odoo_modul_list.write(','.join(c.get('odoo_scripts', 'module_list').split()))
def list_modules(filename: str = 'odoo_modules_list'):
c = configparser.ConfigParser()
c.read(os.path.join(os.getcwd(), 'setup.cfg'))
with open(filename, 'w') as f:
f.write(','.join(c.get('odoo_scripts', 'module_list').split()))
if __name__ == '__main__':
......
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