Merge branch 'develop'
- support private makefile and csv pycharm importation - add default module installation suggested by OCA
This commit is contained in:
commit
00976d766e
4 changed files with 160 additions and 111 deletions
2
Makefile
2
Makefile
|
|
@ -42,7 +42,7 @@ endif
|
||||||
-include ./conf/make.todo.Makefile
|
-include ./conf/make.todo.Makefile
|
||||||
|
|
||||||
# Include private Makefile
|
# Include private Makefile
|
||||||
-include make.private.Makefile
|
-include ./conf/make.private.Makefile
|
||||||
|
|
||||||
# Example for update
|
# Example for update
|
||||||
.PHONY: custom_run_example
|
.PHONY: custom_run_example
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,20 @@
|
||||||
"mail_debrand",
|
"mail_debrand",
|
||||||
"remove_odoo_enterprise",
|
"remove_odoo_enterprise",
|
||||||
"web_responsive",
|
"web_responsive",
|
||||||
"web_timeline"
|
"web_timeline",
|
||||||
|
"server_action_mass_edit",
|
||||||
|
"base_name_search_improved",
|
||||||
|
"partner_firstname",
|
||||||
|
"web_search_with_and",
|
||||||
|
"web_listview_range_select",
|
||||||
|
"web_dialog_size",
|
||||||
|
"password_security",
|
||||||
|
"web_refresher",
|
||||||
|
"date_range",
|
||||||
|
"partner_contact_access_link",
|
||||||
|
"auditlog",
|
||||||
|
"queue_job",
|
||||||
|
"web_advanced_search"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -456,6 +469,17 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"odoo16.0_invoice_qc_ca": {
|
||||||
|
"base": "odoo16.0_base",
|
||||||
|
"disable": false,
|
||||||
|
"image_list": [
|
||||||
|
{
|
||||||
|
"module": [
|
||||||
|
"partner_manual_rank"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"odoo16.0_website_crm": {
|
"odoo16.0_website_crm": {
|
||||||
"base": "odoo16.0_website",
|
"base": "odoo16.0_website",
|
||||||
"disable": false,
|
"disable": false,
|
||||||
|
|
@ -482,7 +506,8 @@
|
||||||
{
|
{
|
||||||
"module": [
|
"module": [
|
||||||
"l10n_ca",
|
"l10n_ca",
|
||||||
"website_sale"
|
"website_sale",
|
||||||
|
"partner_manual_rank"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -500,7 +525,20 @@
|
||||||
"mail_debrand",
|
"mail_debrand",
|
||||||
"remove_odoo_enterprise",
|
"remove_odoo_enterprise",
|
||||||
"web_responsive",
|
"web_responsive",
|
||||||
"web_timeline"
|
"web_timeline",
|
||||||
|
"server_action_mass_edit",
|
||||||
|
"base_name_search_improved",
|
||||||
|
"partner_firstname",
|
||||||
|
"web_search_with_and",
|
||||||
|
"web_listview_range_select",
|
||||||
|
"web_dialog_size",
|
||||||
|
"password_security",
|
||||||
|
"web_refresher",
|
||||||
|
"date_range",
|
||||||
|
"partner_contact_access_link",
|
||||||
|
"auditlog",
|
||||||
|
"queue_job",
|
||||||
|
"web_advanced_search"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -516,7 +554,8 @@
|
||||||
"mrp",
|
"mrp",
|
||||||
"purchase_mrp",
|
"purchase_mrp",
|
||||||
"hr_payroll_community",
|
"hr_payroll_community",
|
||||||
"sale_mrp"
|
"sale_mrp",
|
||||||
|
"partner_manual_rank"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -554,6 +593,7 @@
|
||||||
"om_account_asset",
|
"om_account_asset",
|
||||||
"om_account_budget",
|
"om_account_budget",
|
||||||
"partner_statement",
|
"partner_statement",
|
||||||
|
"partner_manual_rank",
|
||||||
"payment",
|
"payment",
|
||||||
"plm",
|
"plm",
|
||||||
"portal",
|
"portal",
|
||||||
|
|
|
||||||
|
|
@ -258,11 +258,11 @@ class GitTool:
|
||||||
"""
|
"""
|
||||||
lst_filter_group = filter_group.split(",") if filter_group else []
|
lst_filter_group = filter_group.split(",") if filter_group else []
|
||||||
manifest_file = self.get_manifest_file(repo_path=repo_path)
|
manifest_file = self.get_manifest_file(repo_path=repo_path)
|
||||||
if manifest_file.startswith("/home/"):
|
if os.path.isabs(manifest_file):
|
||||||
# This is a absolute path
|
# This is a absolute path
|
||||||
filename = manifest_file
|
filename = manifest_file
|
||||||
else:
|
else:
|
||||||
filename = f"{repo_path}{manifest_file}"
|
filename = os.path.normpath(os.path.join(repo_path, manifest_file))
|
||||||
lst_repo = []
|
lst_repo = []
|
||||||
with open(filename) as xml:
|
with open(filename) as xml:
|
||||||
xml_as_string = xml.read()
|
xml_as_string = xml.read()
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import io
|
||||||
|
|
||||||
import xmltodict
|
import xmltodict
|
||||||
|
|
||||||
|
|
@ -31,6 +32,9 @@ VCS_WORKSPACE = os.path.join(IDEA_PATH, "vcs.xml")
|
||||||
|
|
||||||
PATH_EXCLUDE_FOLDER = "./conf/pycharm_exclude_folder.txt"
|
PATH_EXCLUDE_FOLDER = "./conf/pycharm_exclude_folder.txt"
|
||||||
PATH_DEFAULT_CONFIGURATION = "./conf/pycharm_default_configuration.csv"
|
PATH_DEFAULT_CONFIGURATION = "./conf/pycharm_default_configuration.csv"
|
||||||
|
PATH_DEFAULT_CONFIGURATION_PRIVATE = (
|
||||||
|
"./conf/pycharm_default_configuration.private.csv"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_config():
|
def get_config():
|
||||||
|
|
@ -315,111 +319,116 @@ def add_configuration(dct_xml, file_name, config):
|
||||||
_logger.error(f"Cannot read file '{PATH_DEFAULT_CONFIGURATION}'")
|
_logger.error(f"Cannot read file '{PATH_DEFAULT_CONFIGURATION}'")
|
||||||
return has_change
|
return has_change
|
||||||
with open(PATH_DEFAULT_CONFIGURATION) as txt:
|
with open(PATH_DEFAULT_CONFIGURATION) as txt:
|
||||||
for default_conf in csv.DictReader(txt):
|
content1 = txt.read()
|
||||||
conf_name = default_conf.get("name")
|
if os.path.isfile(PATH_DEFAULT_CONFIGURATION_PRIVATE):
|
||||||
conf_folder = default_conf.get("folder")
|
with open(PATH_DEFAULT_CONFIGURATION_PRIVATE) as txt:
|
||||||
conf_script_path = default_conf.get("script_path")
|
content2 = txt.read()
|
||||||
conf_default = bool(default_conf.get("default"))
|
merged_content = content1 + content2
|
||||||
if conf_default:
|
else:
|
||||||
last_default = f"Python.{conf_name}"
|
merged_content = content1
|
||||||
conf_script_path_replace = (
|
txt_merged = io.StringIO(merged_content)
|
||||||
conf_script_path
|
for default_conf in csv.DictReader(txt_merged):
|
||||||
if not conf_script_path.startswith("./")
|
conf_name = default_conf.get("name")
|
||||||
else f"$PROJECT_DIR${conf_script_path[1:]}"
|
conf_folder = default_conf.get("folder")
|
||||||
)
|
conf_script_path = default_conf.get("script_path")
|
||||||
conf_parameter = default_conf.get("parameters")
|
conf_default = bool(default_conf.get("default"))
|
||||||
s_unique_key = (
|
if conf_default:
|
||||||
f"d {conf_folder} s {conf_script_path} p {conf_parameter}"
|
last_default = f"Python.{conf_name}"
|
||||||
)
|
conf_script_path_replace = (
|
||||||
if (
|
conf_script_path
|
||||||
config.overwrite
|
if not conf_script_path.startswith("./")
|
||||||
or s_unique_key not in lst_unique_configuration
|
else f"$PROJECT_DIR${conf_script_path[1:]}"
|
||||||
):
|
)
|
||||||
# add it!
|
conf_parameter = default_conf.get("parameters")
|
||||||
if not config.overwrite and conf_name in lst_configuration:
|
s_unique_key = (
|
||||||
_logger.error(
|
f"d {conf_folder} s {conf_script_path} p {conf_parameter}"
|
||||||
f"Cannot add configuration name '{conf_name}',"
|
)
|
||||||
" already exist. Delete it manually."
|
if config.overwrite or s_unique_key not in lst_unique_configuration:
|
||||||
)
|
# add it!
|
||||||
else:
|
if not config.overwrite and conf_name in lst_configuration:
|
||||||
has_change = True
|
_logger.error(
|
||||||
lst_xml_configuration_name.append(
|
f"Cannot add configuration name '{conf_name}',"
|
||||||
{"@itemvalue": f"Python.{conf_name}"}
|
" already exist. Delete it manually."
|
||||||
)
|
)
|
||||||
conf_full = {
|
|
||||||
"@name": conf_name,
|
|
||||||
"@type": "PythonConfigurationType",
|
|
||||||
"@factoryName": "Python",
|
|
||||||
"module": {"@name": PROJECT_NAME},
|
|
||||||
"option": [
|
|
||||||
{
|
|
||||||
"@name": "INTERPRETER_OPTIONS",
|
|
||||||
"@value": "",
|
|
||||||
},
|
|
||||||
{"@name": "PARENT_ENVS", "@value": "true"},
|
|
||||||
{
|
|
||||||
"@name": "SDK_HOME",
|
|
||||||
"@value": "$PROJECT_DIR$/.venv/bin/python",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "WORKING_DIRECTORY",
|
|
||||||
"@value": "$PROJECT_DIR$",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "IS_MODULE_SDK",
|
|
||||||
"@value": "false",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "ADD_CONTENT_ROOTS",
|
|
||||||
"@value": "true",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "ADD_SOURCE_ROOTS",
|
|
||||||
"@value": "true",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "SCRIPT_NAME",
|
|
||||||
"@value": conf_script_path_replace,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "PARAMETERS",
|
|
||||||
"@value": conf_parameter,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "SHOW_COMMAND_LINE",
|
|
||||||
"@value": "false",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "EMULATE_TERMINAL",
|
|
||||||
"@value": "false",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "MODULE_MODE",
|
|
||||||
"@value": "false",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@name": "REDIRECT_INPUT",
|
|
||||||
"@value": "false",
|
|
||||||
},
|
|
||||||
{"@name": "INPUT_FILE", "@value": ""},
|
|
||||||
],
|
|
||||||
"envs": {
|
|
||||||
"env": {
|
|
||||||
"@name": "PYTHONUNBUFFERED",
|
|
||||||
"@value": "1",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"EXTENSION": {
|
|
||||||
"@ID": "PythonCoverageRunConfigurationExtension",
|
|
||||||
"@runner": "coverage.py",
|
|
||||||
},
|
|
||||||
"method": {"@v": "2"},
|
|
||||||
}
|
|
||||||
if conf_folder:
|
|
||||||
conf_full["@folderName"] = conf_folder
|
|
||||||
lst_configuration_full.insert(0, conf_full)
|
|
||||||
else:
|
else:
|
||||||
_logger.info(f"Configuration already exist: '{s_unique_key}'")
|
has_change = True
|
||||||
|
lst_xml_configuration_name.append(
|
||||||
|
{"@itemvalue": f"Python.{conf_name}"}
|
||||||
|
)
|
||||||
|
conf_full = {
|
||||||
|
"@name": conf_name,
|
||||||
|
"@type": "PythonConfigurationType",
|
||||||
|
"@factoryName": "Python",
|
||||||
|
"module": {"@name": PROJECT_NAME},
|
||||||
|
"option": [
|
||||||
|
{
|
||||||
|
"@name": "INTERPRETER_OPTIONS",
|
||||||
|
"@value": "",
|
||||||
|
},
|
||||||
|
{"@name": "PARENT_ENVS", "@value": "true"},
|
||||||
|
{
|
||||||
|
"@name": "SDK_HOME",
|
||||||
|
"@value": "$PROJECT_DIR$/.venv/bin/python",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "WORKING_DIRECTORY",
|
||||||
|
"@value": "$PROJECT_DIR$",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "IS_MODULE_SDK",
|
||||||
|
"@value": "false",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "ADD_CONTENT_ROOTS",
|
||||||
|
"@value": "true",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "ADD_SOURCE_ROOTS",
|
||||||
|
"@value": "true",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "SCRIPT_NAME",
|
||||||
|
"@value": conf_script_path_replace,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "PARAMETERS",
|
||||||
|
"@value": conf_parameter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "SHOW_COMMAND_LINE",
|
||||||
|
"@value": "false",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "EMULATE_TERMINAL",
|
||||||
|
"@value": "false",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "MODULE_MODE",
|
||||||
|
"@value": "false",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@name": "REDIRECT_INPUT",
|
||||||
|
"@value": "false",
|
||||||
|
},
|
||||||
|
{"@name": "INPUT_FILE", "@value": ""},
|
||||||
|
],
|
||||||
|
"envs": {
|
||||||
|
"env": {
|
||||||
|
"@name": "PYTHONUNBUFFERED",
|
||||||
|
"@value": "1",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"EXTENSION": {
|
||||||
|
"@ID": "PythonCoverageRunConfigurationExtension",
|
||||||
|
"@runner": "coverage.py",
|
||||||
|
},
|
||||||
|
"method": {"@v": "2"},
|
||||||
|
}
|
||||||
|
if conf_folder:
|
||||||
|
conf_full["@folderName"] = conf_folder
|
||||||
|
lst_configuration_full.insert(0, conf_full)
|
||||||
|
else:
|
||||||
|
_logger.info(f"Configuration already exist: '{s_unique_key}'")
|
||||||
|
|
||||||
if last_default:
|
if last_default:
|
||||||
dct_component["@selected"] = last_default
|
dct_component["@selected"] = last_default
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue