diff --git a/dist/distrobuilder_menu-0.1.3.tar.gz b/dist/distrobuilder_menu-0.1.3.tar.gz deleted file mode 100644 index 4897559..0000000 Binary files a/dist/distrobuilder_menu-0.1.3.tar.gz and /dev/null differ diff --git a/dist/distrobuilder_menu-0.1.3-py3-none-any.whl b/dist/distrobuilder_menu-0.1.4-py3-none-any.whl similarity index 87% rename from dist/distrobuilder_menu-0.1.3-py3-none-any.whl rename to dist/distrobuilder_menu-0.1.4-py3-none-any.whl index 4464a72..c9be20f 100644 Binary files a/dist/distrobuilder_menu-0.1.3-py3-none-any.whl and b/dist/distrobuilder_menu-0.1.4-py3-none-any.whl differ diff --git a/dist/distrobuilder_menu-0.1.4.tar.gz b/dist/distrobuilder_menu-0.1.4.tar.gz new file mode 100644 index 0000000..681c5fe Binary files /dev/null and b/dist/distrobuilder_menu-0.1.4.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 3e2f88c..8817afe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "hatchling.build" [project] name = "distrobuilder_menu" -version = "0.1.3" +version = "0.1.4" authors = [ { name="Stuart Cardall", email="developer@it-offshore.co.uk" }, ] diff --git a/src/distrobuilder_menu/menus/common.py b/src/distrobuilder_menu/menus/common.py index f84e980..0337783 100644 --- a/src/distrobuilder_menu/menus/common.py +++ b/src/distrobuilder_menu/menus/common.py @@ -108,7 +108,8 @@ def menu_versions(template, version_list, template_path): # get_menu_context() is for directory type menus # there is only one instance of this file type menu so construct title / question title = f"Build {container_type} Variant" - question = f"Choose {container_type} variant to build from template: {template}" + template_type = helpers.get_template_type(template_path) + question = f"Build {container_type} variant from {template_type} template: {template}" # generate menu (see menus.py) # get_choice() returns a list index here @@ -393,10 +394,7 @@ def generate_custom_template(): return # show context - if USER_CONFIG.subdir_images in src_template: - src_type = 'standard' - else: - src_type = 'custom' + src_type = helpers.get_template_type(src_template) print(f"\nOverriding {src_type} SOURCE template: {os_name}") # choose OVERRIDE file / menu diff --git a/src/distrobuilder_menu/menus/helpers.py b/src/distrobuilder_menu/menus/helpers.py index fa73025..de5ae63 100644 --- a/src/distrobuilder_menu/menus/helpers.py +++ b/src/distrobuilder_menu/menus/helpers.py @@ -80,6 +80,21 @@ def get_menu_context(template_dir, pre_str, action): return menu_context +def get_template_type(template): + """ Convenience function for template types + + Args: + template (path): path to the template + + Returns: 'standard' || 'custom' + """ + if USER_CONFIG.subdir_images in template: + template_type = 'standard' + else: + template_type = 'custom' + return template_type + + def select_file_paths(): """ Used by create_custom_override() to add the file paths to include in the override file used to generate a custom template