diff --git a/docker/repo_manifest_gen_org_prefix_path.py b/docker/repo_manifest_gen_org_prefix_path.py index 03f53ec..a1269d3 100755 --- a/docker/repo_manifest_gen_org_prefix_path.py +++ b/docker/repo_manifest_gen_org_prefix_path.py @@ -1,29 +1,34 @@ #!/usr/bin/env python -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse - -from os import listdir -from os.path import isdir, join, abspath - import configparser +from os import listdir +from os.path import abspath, isdir, join -parser = argparse.ArgumentParser(prog='Configure base dir for all addons') +parser = argparse.ArgumentParser(prog="Configure base dir for all addons") parser.add_argument("addonsBaseDir", help="Path where addons are cloned.") -parser.add_argument("srcConfigPath", - help="Path where we retrieve source config file to adapt with new " - "addons path.") -parser.add_argument("dstConfigPath", help="Path to save adapted configuration.") +parser.add_argument( + "srcConfigPath", + help="Path where we retrieve source config file to adapt with new " + "addons path.", +) +parser.add_argument( + "dstConfigPath", help="Path to save adapted configuration." +) args = parser.parse_args() addonsBaseDir = args.addonsBaseDir srcConfigPath = args.srcConfigPath dstConfigPath = args.dstConfigPath -addonsDirs = [abspath(join(addonsBaseDir, f)) for f in listdir(addonsBaseDir) if - isdir(join(addonsBaseDir, f))] +addonsDirs = [ + abspath(join(addonsBaseDir, f)) + for f in listdir(addonsBaseDir) + if isdir(join(addonsBaseDir, f)) +] with open(".odoo-version", "r") as f: odoo_version = f.readline().strip() @@ -39,9 +44,9 @@ config.read(srcConfigPath) separator = "," -config.set('options', 'addons_path', separator.join(addonsDirs)) +config.set("options", "addons_path", separator.join(addonsDirs)) -print(config.get('options', 'addons_path')) +print(config.get("options", "addons_path")) -with open(dstConfigPath, 'w') as configfile: +with open(dstConfigPath, "w") as configfile: config.write(configfile) diff --git a/docker/wait-for-psql.py b/docker/wait-for-psql.py index a15b8f6..e423fec 100755 --- a/docker/wait-for-psql.py +++ b/docker/wait-for-psql.py @@ -1,20 +1,21 @@ #!/usr/bin/env python -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse -import psycopg2 import sys import time -if __name__ == '__main__': +import psycopg2 + +if __name__ == "__main__": arg_parser = argparse.ArgumentParser() - arg_parser.add_argument('--db_host', required=True) - arg_parser.add_argument('--db_port', required=True) - arg_parser.add_argument('--db_user', required=True) - arg_parser.add_argument('--db_password', required=True) - arg_parser.add_argument('--db_name', required=False, default="postgres") - arg_parser.add_argument('--timeout', type=int, default=10) + arg_parser.add_argument("--db_host", required=True) + arg_parser.add_argument("--db_port", required=True) + arg_parser.add_argument("--db_user", required=True) + arg_parser.add_argument("--db_password", required=True) + arg_parser.add_argument("--db_name", required=False, default="postgres") + arg_parser.add_argument("--timeout", type=int, default=10) args = arg_parser.parse_args() @@ -22,12 +23,16 @@ if __name__ == '__main__': print("Try connection to postgres...") connected = False - error = '' + error = "" while ((time.time() - start_time) < args.timeout) or connected is True: try: - conn = psycopg2.connect(user=args.db_user, host=args.db_host, - port=args.db_port, password=args.db_password, - dbname=args.db_name) + conn = psycopg2.connect( + user=args.db_user, + host=args.db_host, + port=args.db_port, + password=args.db_password, + dbname=args.db_name, + ) break except psycopg2.OperationalError as e: error = e diff --git a/script/addons/check_addons_exist.py b/script/addons/check_addons_exist.py index 0e9299b..11ff625 100755 --- a/script/addons/check_addons_exist.py +++ b/script/addons/check_addons_exist.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/create_from_existing_module.py b/script/code_generator/create_from_existing_module.py index 708d3f2..bf451be 100755 --- a/script/code_generator/create_from_existing_module.py +++ b/script/code_generator/create_from_existing_module.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/new_project.py b/script/code_generator/new_project.py index 4a9227a..6c4a472 100755 --- a/script/code_generator/new_project.py +++ b/script/code_generator/new_project.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse @@ -14,7 +14,6 @@ import uuid from git import Repo from git.exc import InvalidGitRepositoryError, NoSuchPathError - logging.basicConfig( format=( "%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d]" @@ -383,10 +382,7 @@ class ProjectManagement: os.system(cmd) if not self.keep_bd_alive: - cmd = ( - "./odoo_bin.sh db --drop --database" - f" {bd_name_demo}" - ) + cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_demo}" _logger.info(cmd) os.system(cmd) @@ -467,10 +463,7 @@ class ProjectManagement: os.system(cmd) if not self.keep_bd_alive: - cmd = ( - "./odoo_bin.sh db --drop --database" - f" {bd_name_template}" - ) + cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_template}" _logger.info(cmd) os.system(cmd) @@ -538,10 +531,7 @@ class ProjectManagement: os.system(cmd) if not self.keep_bd_alive: - cmd = ( - "./odoo_bin.sh db --drop --database" - f" {bd_name_generator}" - ) + cmd = "./odoo_bin.sh db --drop --database" f" {bd_name_generator}" _logger.info(cmd) os.system(cmd) diff --git a/script/code_generator/search_class_model.py b/script/code_generator/search_class_model.py index 33fade2..fb6d9d3 100755 --- a/script/code_generator/search_class_model.py +++ b/script/code_generator/search_class_model.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/technical/transform_xml_data_website_page_to_controller.py b/script/code_generator/technical/transform_xml_data_website_page_to_controller.py index 6d2fc41..0b0054f 100644 --- a/script/code_generator/technical/transform_xml_data_website_page_to_controller.py +++ b/script/code_generator/technical/transform_xml_data_website_page_to_controller.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/test_code_generator_update_module.py b/script/code_generator/test_code_generator_update_module.py index 62cbf4c..91040a5 100755 --- a/script/code_generator/test_code_generator_update_module.py +++ b/script/code_generator/test_code_generator_update_module.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/test_transform_python_to_code_writer.py b/script/code_generator/test_transform_python_to_code_writer.py index c2e9472..2dff2a8 100644 --- a/script/code_generator/test_transform_python_to_code_writer.py +++ b/script/code_generator/test_transform_python_to_code_writer.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/transform_python_to_code_writer.py b/script/code_generator/transform_python_to_code_writer.py index e1a16f3..d60ac6a 100755 --- a/script/code_generator/transform_python_to_code_writer.py +++ b/script/code_generator/transform_python_to_code_writer.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/code_generator/transform_xml_to_code_writer.py b/script/code_generator/transform_xml_to_code_writer.py index b9689d4..b35f49d 100644 --- a/script/code_generator/transform_xml_to_code_writer.py +++ b/script/code_generator/transform_xml_to_code_writer.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/database/compare_backup.py b/script/database/compare_backup.py index ddbf58a..52114bf 100755 --- a/script/database/compare_backup.py +++ b/script/database/compare_backup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/database/compare_database_application.py b/script/database/compare_database_application.py index 90cb5b6..15f1ac4 100755 --- a/script/database/compare_database_application.py +++ b/script/database/compare_database_application.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/database/db_drop_all.py b/script/database/db_drop_all.py index a72066c..ed0fd77 100755 --- a/script/database/db_drop_all.py +++ b/script/database/db_drop_all.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/database/db_restore.py b/script/database/db_restore.py index a1629e8..e6a0bd0 100755 --- a/script/database/db_restore.py +++ b/script/database/db_restore.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/database/download_remote.py b/script/database/download_remote.py index 5e6f239..12e12b5 100644 --- a/script/database/download_remote.py +++ b/script/database/download_remote.py @@ -1,40 +1,48 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -print("This script only work with localhost:8069, not working with remote instance.") +print( + "This script only work with localhost:8069, not working with remote instance." +) -import requests -import sys import logging +import sys from pathlib import Path -ODOO_URL = '' # Your Odoo server URL -DATABASE_NAME = '' -MASTER_PASSWORD = '' +import requests + +ODOO_URL = "" # Your Odoo server URL +DATABASE_NAME = "" +MASTER_PASSWORD = "" # BACKUP_FORMAT = env('BACKUP_FORMAT', default='zip') # 'zip' or 'dump' -BACKUP_FORMAT = 'zip' # 'zip' or 'dump' -OUTPUT_FILE_NAME = f'{DATABASE_NAME}_backup.{BACKUP_FORMAT}' +BACKUP_FORMAT = "zip" # 'zip' or 'dump' +OUTPUT_FILE_NAME = f"{DATABASE_NAME}_backup.{BACKUP_FORMAT}" # --- Logger Setup --- logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) # TODO not working with remote, only localhost -logger.error("This script is not working with remote instance, only http://127.0.0.1:8069") +logger.error( + "This script is not working with remote instance, only http://127.0.0.1:8069" +) + # --- Function to download the database --- def download_odoo_db(): - logger.info(f"Attempting to download database '{DATABASE_NAME}' from URL '{ODOO_URL}'...") + logger.info( + f"Attempting to download database '{DATABASE_NAME}' from URL '{ODOO_URL}'..." + ) # URL for the backup endpoint - backup_url = f'{ODOO_URL}/web/database/backup' + backup_url = f"{ODOO_URL}/web/database/backup" # Form data for the POST request payload = { - 'master_pwd': MASTER_PASSWORD, - 'name': DATABASE_NAME, - 'backup_format': BACKUP_FORMAT, + "master_pwd": MASTER_PASSWORD, + "name": DATABASE_NAME, + "backup_format": BACKUP_FORMAT, } try: @@ -43,20 +51,28 @@ def download_odoo_db(): response.raise_for_status() # Raise an exception for bad status codes # --- VALIDATION --- - content_type = response.headers.get('Content-Type', '').split(';')[0] + content_type = response.headers.get("Content-Type", "").split(";")[0] # Check if the content type is valid - expected_types = ['application/zip', 'application/octet-stream'] + expected_types = ["application/zip", "application/octet-stream"] if content_type not in expected_types: - logger.error(f"ERROR: Expected one of {expected_types} but got {content_type}.") - logger.error("This usually indicates a server-side error or an incorrect master password.") + logger.error( + f"ERROR: Expected one of {expected_types} but got {content_type}." + ) + logger.error( + "This usually indicates a server-side error or an incorrect master password." + ) sys.exit(1) # Check if the content is an HTML page (to handle incorrect passwords) - first_chunk = next(response.iter_content(chunk_size=128), b'') - if first_chunk.startswith(b'<'): - logger.error("ERROR: It seems the server returned an HTML page instead of a database file.") - logger.error("This is often due to an incorrect master password or an invalid request.") + first_chunk = next(response.iter_content(chunk_size=128), b"") + if first_chunk.startswith(b"<"): + logger.error( + "ERROR: It seems the server returned an HTML page instead of a database file." + ) + logger.error( + "This is often due to an incorrect master password or an invalid request." + ) logger.error("Server Response (First 200 chars):") logger.error(response.text[:200]) sys.exit(1) @@ -65,26 +81,35 @@ def download_odoo_db(): logger.info(f"Download started, saving to '{OUTPUT_FILE_NAME}'...") output_path = Path(OUTPUT_FILE_NAME) - with open(output_path, 'wb') as f: + with open(output_path, "wb") as f: # Write the content from the first chunk to the file f.write(first_chunk) # Continue writing the rest of the stream in chunks for chunk in response.iter_content(chunk_size=8192): f.write(chunk) - logger.info(f"Download successful! File saved at: {output_path.resolve()}") + logger.info( + f"Download successful! File saved at: {output_path.resolve()}" + ) except requests.exceptions.RequestException as e: - logger.error(f"An error occurred while connecting to the Odoo server: {e}") + logger.error( + f"An error occurred while connecting to the Odoo server: {e}" + ) except Exception as e: logger.error(f"An unexpected error occurred: {e}") # --- Script execution --- -if __name__ == '__main__': +if __name__ == "__main__": # Add a simple check to ensure the user has configured the variables - if ODOO_URL == 'http://localhost:8069' and DATABASE_NAME == 'your_database_name': - logger.error("Please configure the ODOO_URL, DATABASE_NAME, and MASTER_PASSWORD variables at the start of the script.") + if ( + ODOO_URL == "http://localhost:8069" + and DATABASE_NAME == "your_database_name" + ): + logger.error( + "Please configure the ODOO_URL, DATABASE_NAME, and MASTER_PASSWORD variables at the start of the script." + ) sys.exit(1) download_odoo_db() diff --git a/script/database/fix_mariadb_sql_example_1.py b/script/database/fix_mariadb_sql_example_1.py index 5a69f1f..333baff 100755 --- a/script/database/fix_mariadb_sql_example_1.py +++ b/script/database/fix_mariadb_sql_example_1.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from collections import defaultdict @@ -161,19 +161,19 @@ def delete_record(cr): cr.execute(query_search) query_search = """ - DELETE FROM `tbl_commande_membre_produit` + DELETE FROM `tbl_commande_membre_produit` WHERE NoFournisseurProduitCommande in (22659, 22724, 22662, 22663, 22732, 22670, 22705, 22737, 22741, 22679, 22680, 22682, 22655); """ cr.execute(query_search) query_search = """ - DELETE FROM `tbl_echange_service` + DELETE FROM `tbl_echange_service` WHERE NoMembreVendeur in (7703); """ cr.execute(query_search) query_search = """ - DELETE FROM `tbl_categorie_sous_categorie` + DELETE FROM `tbl_categorie_sous_categorie` WHERE NoCategorie in (999); """ cr.execute(query_search) @@ -210,7 +210,7 @@ def migrate_record(cr): i = 0 for sous_categorie_id in lst_sous_categorie: i += 1 - query_search = f"""UPDATE tbl_sous_categorie set NoSousCategorieId={i} + query_search = f"""UPDATE tbl_sous_categorie set NoSousCategorieId={i} WHERE NoCategorie={sous_categorie_id[1]} and NoSousCategorie='{sous_categorie_id[0]}' """ cr.execute(query_search) @@ -232,7 +232,7 @@ def migrate_record(cr): f"Get null from {categorie_sous_categorie_id[2]} and" f" {categorie_sous_categorie_id[1]}" ) - query_search = f"""UPDATE tbl_categorie_sous_categorie set NoSousCategorieId={id_sous_categorie} + query_search = f"""UPDATE tbl_categorie_sous_categorie set NoSousCategorieId={id_sous_categorie} WHERE NoCategorieSousCategorie={categorie_sous_categorie_id[0]} """ cr.execute(query_search) diff --git a/script/database/image_db.py b/script/database/image_db.py index f519a0e..a7ae69f 100755 --- a/script/database/image_db.py +++ b/script/database/image_db.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse @@ -301,18 +301,13 @@ def main(): all_temp_bd = [] # Step 0, drop and restore - cmd_drop_db = ( - f"./odoo_bin.sh db --drop --database {bd_temp_name}" - ) + cmd_drop_db = f"./odoo_bin.sh db --drop --database {bd_temp_name}" all_temp_bd.append(bd_temp_name) run_cmd(cmd_drop_db) if not base_image_name or base_image_name == image_name_to_generate: with_demo = dct_config_image.get("with_demo") # Create a new one - cmd = ( - f"./odoo_bin.sh db --create --database" - f" {bd_temp_name}" - ) + cmd = f"./odoo_bin.sh db --create --database" f" {bd_temp_name}" if with_demo: cmd += " --demo" else: @@ -352,9 +347,7 @@ def main(): # Step 6, clean if ask if not config.keep_database: for db_name in all_temp_bd: - cmd_drop_db = ( - f"./odoo_bin.sh db --drop --database {db_name}" - ) + cmd_drop_db = f"./odoo_bin.sh db --drop --database {db_name}" run_cmd(cmd_drop_db) diff --git a/script/deployment/cloudflare_dns.py b/script/deployment/cloudflare_dns.py index 45a5744..48cead1 100755 --- a/script/deployment/cloudflare_dns.py +++ b/script/deployment/cloudflare_dns.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/deployment/get_public_ip.py b/script/deployment/get_public_ip.py index e7f7405..d71307c 100755 --- a/script/deployment/get_public_ip.py +++ b/script/deployment/get_public_ip.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import requests diff --git a/script/deployment/update_dns_cloudflare.py b/script/deployment/update_dns_cloudflare.py index 98d1d27..8490ba7 100755 --- a/script/deployment/update_dns_cloudflare.py +++ b/script/deployment/update_dns_cloudflare.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/docker/docker_update_version.py b/script/docker/docker_update_version.py index 842cc84..ce18cd3 100755 --- a/script/docker/docker_update_version.py +++ b/script/docker/docker_update_version.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse @@ -7,7 +7,6 @@ import logging import os import sys - new_path = os.path.normpath( os.path.join(os.path.dirname(__file__), "..", "..") ) diff --git a/script/git/fork_project.py b/script/git/fork_project.py index 31a84cf..b9b6c5f 100755 --- a/script/git/fork_project.py +++ b/script/git/fork_project.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/fork_project_ERPLibre.py b/script/git/fork_project_ERPLibre.py index 16c4e9e..a91a034 100755 --- a/script/git/fork_project_ERPLibre.py +++ b/script/git/fork_project_ERPLibre.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_change_remote.py b/script/git/git_change_remote.py index 1fadcef..8158267 100755 --- a/script/git/git_change_remote.py +++ b/script/git/git_change_remote.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_change_remote_https_to_git.py b/script/git/git_change_remote_https_to_git.py index 6e39ff3..3cff9a8 100755 --- a/script/git/git_change_remote_https_to_git.py +++ b/script/git/git_change_remote_https_to_git.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_diff_repo_manifest.py b/script/git/git_diff_repo_manifest.py index af86aec..c112874 100755 --- a/script/git/git_diff_repo_manifest.py +++ b/script/git/git_diff_repo_manifest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_merge_repo_manifest.py b/script/git/git_merge_repo_manifest.py index 3f4940e..3a7bb48 100755 --- a/script/git/git_merge_repo_manifest.py +++ b/script/git/git_merge_repo_manifest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse @@ -24,7 +24,9 @@ DEFAULT_PATH_MANIFEST_ODOO_CONF = os.path.join("conf", "git_manifest_odoo.csv") DEFAULT_PATH_MANIFEST_PRIVATE_CONF = os.path.join( "private", "default_git_manifest.csv" ) -DEFAULT_PATH_INSTALLED_ODOO_VERSION = os.path.join(".repo", "installed_odoo_version.txt") +DEFAULT_PATH_INSTALLED_ODOO_VERSION = os.path.join( + ".repo", "installed_odoo_version.txt" +) def get_config(): @@ -44,7 +46,11 @@ def get_config(): "--input", help="First manifest to merge into input2. Second manifest, overwrite by input1.", ) - parser.add_argument("--output", default=".repo/local_manifests/erplibre_manifest.xml", help="Output of new manifest") + parser.add_argument( + "--output", + default=".repo/local_manifests/erplibre_manifest.xml", + help="Output of new manifest", + ) parser.add_argument( "--att_revision_only", action="store_true", @@ -89,11 +95,14 @@ def main(): if os.path.exists(DEFAULT_PATH_INSTALLED_ODOO_VERSION): with open(DEFAULT_PATH_INSTALLED_ODOO_VERSION, "r") as f: - lst_installed_odoo_version = [a.strip() for a in f.readlines()] + lst_installed_odoo_version = [ + a.strip() for a in f.readlines() + ] if lst_installed_odoo_version: for installed_odoo_version in lst_installed_odoo_version: path_manifest_odoo_version = os.path.join( - "manifest", f"git_manifest_{installed_odoo_version}.xml" + "manifest", + f"git_manifest_{installed_odoo_version}.xml", ) if os.path.exists(path_manifest_odoo_version): lst_input.append(path_manifest_odoo_version) @@ -102,7 +111,8 @@ def main(): f"ERROR: {path_manifest_odoo_version} does not exist" ) path_manifest_odoo_version = os.path.join( - "manifest", f"git_manifest_{installed_odoo_version}_dev.xml" + "manifest", + f"git_manifest_{installed_odoo_version}_dev.xml", ) if os.path.exists(path_manifest_odoo_version): lst_input.append(path_manifest_odoo_version) diff --git a/script/git/git_repo_manifest.py b/script/git/git_repo_manifest.py index 0a5a391..2a08ead 100755 --- a/script/git/git_repo_manifest.py +++ b/script/git/git_repo_manifest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_repo_update_group.py b/script/git/git_repo_update_group.py index d7c2128..882af4b 100755 --- a/script/git/git_repo_update_group.py +++ b/script/git/git_repo_update_group.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_show_code_diff_repo_manifest.py b/script/git/git_show_code_diff_repo_manifest.py index dc0555c..dc18d84 100755 --- a/script/git/git_show_code_diff_repo_manifest.py +++ b/script/git/git_show_code_diff_repo_manifest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/git_tool.py b/script/git/git_tool.py index ac8623a..47c1f14 100644 --- a/script/git/git_tool.py +++ b/script/git/git_tool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import os diff --git a/script/git/git_update_repo.py b/script/git/git_update_repo.py index 5106640..aa94fab 100755 --- a/script/git/git_update_repo.py +++ b/script/git/git_update_repo.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/pull_request_ERPLibre.py b/script/git/pull_request_ERPLibre.py index 1c98a74..aa11e39 100755 --- a/script/git/pull_request_ERPLibre.py +++ b/script/git/pull_request_ERPLibre.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/remote_code_generation_git_compare.py b/script/git/remote_code_generation_git_compare.py index c88e8d7..48e79be 100755 --- a/script/git/remote_code_generation_git_compare.py +++ b/script/git/remote_code_generation_git_compare.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/repo_remove_auto_install.py b/script/git/repo_remove_auto_install.py index af5ff44..9c5423e 100755 --- a/script/git/repo_remove_auto_install.py +++ b/script/git/repo_remove_auto_install.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/repo_revert_git_diff_date_from_code_generator.py b/script/git/repo_revert_git_diff_date_from_code_generator.py index 71ef527..b7fdd34 100755 --- a/script/git/repo_revert_git_diff_date_from_code_generator.py +++ b/script/git/repo_revert_git_diff_date_from_code_generator.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/git/tag_push_all.py b/script/git/tag_push_all.py index e73b58e..79732c7 100755 --- a/script/git/tag_push_all.py +++ b/script/git/tag_push_all.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/ide/pycharm_configuration.py b/script/ide/pycharm_configuration.py index cbd7822..1e025e8 100755 --- a/script/ide/pycharm_configuration.py +++ b/script/ide/pycharm_configuration.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/lib_asyncio.py b/script/lib_asyncio.py index 1afe978..36843f2 100644 --- a/script/lib_asyncio.py +++ b/script/lib_asyncio.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import asyncio diff --git a/script/poetry/poetry_update.py b/script/poetry/poetry_update.py index c96d672..d25b67a 100755 --- a/script/poetry/poetry_update.py +++ b/script/poetry/poetry_update.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/restful/restful_example.py b/script/restful/restful_example.py index fa9cf4a..c9fc4d9 100755 --- a/script/restful/restful_example.py +++ b/script/restful/restful_example.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import json diff --git a/script/selenium/scenario/selenium_devops.py b/script/selenium/scenario/selenium_devops.py index d275101..d241d84 100755 --- a/script/selenium/scenario/selenium_devops.py +++ b/script/selenium/scenario/selenium_devops.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/selenium/selenium_lib.py b/script/selenium/selenium_lib.py index 2cf9a9d..1314b19 100644 --- a/script/selenium/selenium_lib.py +++ b/script/selenium/selenium_lib.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import datetime diff --git a/script/selenium/web_login.py b/script/selenium/web_login.py index f979896..c8e361f 100755 --- a/script/selenium/web_login.py +++ b/script/selenium/web_login.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/statistic/show_evolution_module.py b/script/statistic/show_evolution_module.py index 50897fd..e0bf450 100755 --- a/script/statistic/show_evolution_module.py +++ b/script/statistic/show_evolution_module.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/systemd/install_daemon.py b/script/systemd/install_daemon.py index bfd6008..6ed8332 100755 --- a/script/systemd/install_daemon.py +++ b/script/systemd/install_daemon.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse @@ -97,7 +97,10 @@ def main(): # Default paths and fallback values (same logic as in the bash script) el_user = args.user el_home_erplibre = args.home_erplibre or os.getcwd() - el_config_name = args.config_name or f"erplibre_{el_user}_{os.path.basename(os.getcwd())}" + el_config_name = ( + args.config_name + or f"erplibre_{el_user}_{os.path.basename(os.getcwd())}" + ) exec_param = ( " " + f" {w_cmd("-d", args.database or "")} {w_cmd("-p", args.port or "")}".strip() diff --git a/script/test/run_parallel_test.py b/script/test/run_parallel_test.py index 2bd949c..837ab7b 100755 --- a/script/test/run_parallel_test.py +++ b/script/test/run_parallel_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/version/get_version.py b/script/version/get_version.py index e4bd7f0..ff503ea 100755 --- a/script/version/get_version.py +++ b/script/version/get_version.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) import argparse diff --git a/script/version/update_env_version.py b/script/version/update_env_version.py index 554d858..d63b9db 100755 --- a/script/version/update_env_version.py +++ b/script/version/update_env_version.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# © 2021-2024 TechnoLibre (http://www.technolibre.ca) +# © 2021-2025 TechnoLibre (http://www.technolibre.ca) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) # This script need only basic importation, it needs to be supported by python of your system