Browse Source

renamed 'release' to 'build'

master
Holger Frey 2 years ago
parent
commit
0649036665
  1. 4
      pyproject.toml
  2. 2
      work_helpers/__init__.py
  3. 30
      work_helpers/sg_mbp_build.py

4
pyproject.toml

@ -24,8 +24,8 @@ nice_path = "work_helpers.nice_path:make_nice_path" @@ -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"

2
work_helpers/__init__.py

@ -1,3 +1,3 @@ @@ -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"

30
work_helpers/sg_mbp_release.py → work_helpers/sg_mbp_build.py

@ -105,39 +105,39 @@ def create_changelog_entry(new_version, parent=PATH_ISSUES): @@ -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): @@ -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): @@ -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)
Loading…
Cancel
Save