From 064903666593ffa9721e8cfccb84ebb66a8e17a8 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Tue, 9 May 2023 10:33:05 +0200 Subject: [PATCH] renamed 'release' to 'build' --- pyproject.toml | 4 +-- work_helpers/__init__.py | 2 +- .../{sg_mbp_release.py => sg_mbp_build.py} | 30 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) rename work_helpers/{sg_mbp_release.py => sg_mbp_build.py} (84%) diff --git a/pyproject.toml b/pyproject.toml index e606f11..499a070 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ nice_path = "work_helpers.nice_path:make_nice_path" random_password = "work_helpers.password:get_random_password" sensospot_rename = "work_helpers.sensospot_rename:sensospot_rename" sg_list_frms = "work_helpers.sg_frm_list:cli" -sg_mbp_new_version = "work_helpers.sg_mbp_release:sg_mbp_new_version" -sg_mbp_release = "work_helpers.sg_mbp_release:sg_mbp_release" +sg_mbp_new_version = "work_helpers.sg_mbp_build:sg_mbp_new_version" +sg_mbp_build = "work_helpers.sg_mbp_build:sg_mbp_build" xls2changelog = "work_helpers.excel2changelog:cli" xls2markdown = "work_helpers.excel2markdown:cli" xls2pylist = "work_helpers.excel2pylist:cli" diff --git a/work_helpers/__init__.py b/work_helpers/__init__.py index 0ea1c75..5d4657f 100644 --- a/work_helpers/__init__.py +++ b/work_helpers/__init__.py @@ -1,3 +1,3 @@ """ Some helper scripts for the day to day work with Ubuntu in WSL2 """ -__version__ = "0.0.1" +__version__ = "0.0.2" diff --git a/work_helpers/sg_mbp_release.py b/work_helpers/sg_mbp_build.py similarity index 84% rename from work_helpers/sg_mbp_release.py rename to work_helpers/sg_mbp_build.py index 8e4286b..ce6db9f 100644 --- a/work_helpers/sg_mbp_release.py +++ b/work_helpers/sg_mbp_build.py @@ -105,39 +105,39 @@ def create_changelog_entry(new_version, parent=PATH_ISSUES): fh.write(CRLF.join(content)) -def copy_changelog(destination, release_version): +def copy_changelog(destination, build_version): textfiles = _files_in_folder(PATH_ISSUES, ".txt") changelog = next(f for f in textfiles if f.stem.lower().startswith("change")) - new_path = destination / f"CHANGELOG {release_version}.txt" + new_path = destination / f"CHANGELOG {build_version}.txt" print(changelog.name, "->", new_path) shutil.copyfile(changelog, new_path) -def copy_workbook_changelogs(destination, latest, release_version): +def copy_workbook_changelogs(destination, latest, build_version): source = PATH_ISSUES / latest textfiles = _files_in_folder(source, ".txt") logs = (f for f in textfiles if f.stem.lower().startswith("change")) for log_file in logs: - new_name = log_file.name.replace(latest, release_version) + new_name = log_file.name.replace(latest, build_version) new_path = destination / new_name print(log_file.name, "->", new_path) shutil.copyfile(log_file, new_path) -def copy_workbooks(destination, release_version): +def copy_workbooks(destination, build_version): all_xls_files = _files_in_folder(PATH_WORKBOOKS, ".xlsx") mbp_files = (f for f in all_xls_files if f.name.lower().startswith("mbp")) for excel_file in mbp_files: new_name = WORKBOOKS_MAP[excel_file.name] - new_path = destination / new_name.format(version=release_version) + new_path = destination / new_name.format(version=build_version) print(excel_file.name, "->", new_path) shutil.copyfile(excel_file, new_path) -def copy_frms(destination, release_version): +def copy_frms(destination, build_version): all_folders = (f for f in PATH_WORKBOOKS.iterdir() if f.is_dir()) all_frms = (f for f in all_folders if "frm" in f.name.lower()) - current_frms = (f for f in all_frms if f.name.endswith(release_version)) + current_frms = (f for f in all_frms if f.name.endswith(build_version)) for folder in current_frms: new_path = destination / folder.name print(folder.name, "->", new_path) @@ -173,7 +173,7 @@ def sg_mbp_new_version(version): required=True, default="", ) -def sg_mbp_release(dev_version): +def sg_mbp_build(dev_version): """ Before running this command: @@ -186,16 +186,16 @@ def sg_mbp_release(dev_version): The command will collect all data into one folder on the Desktop to be published """ latest = get_latest_version() - release_version = f"{latest}{dev_version}" + build_version = f"{latest}{dev_version}" - new_folder_name = f"{TODAY} {release_version}" + new_folder_name = f"{TODAY} {build_version}" new_folder_path = PATH_WIN_DESKTOP / new_folder_name if new_folder_path.exists(): raise IOError(f"Folder exists on desktop: {new_folder_name}") else: new_folder_path.mkdir() - copy_workbooks(new_folder_path, release_version) - copy_workbook_changelogs(new_folder_path, latest, release_version) - copy_changelog(new_folder_path, release_version) - copy_frms(new_folder_path, release_version) + copy_workbooks(new_folder_path, build_version) + copy_workbook_changelogs(new_folder_path, latest, build_version) + copy_changelog(new_folder_path, build_version) + copy_frms(new_folder_path, build_version)