Esempio n. 1
0
def about_program_message():
    """Displays the strings contained in rosevomit.core.about.PROGRAM. Accepts no parameters, returns nothing."""
    print()
    for string in about.PROGRAM:
        formatting.printwrap(string)
        print()
    general_program_message("   ")
    print()
Esempio n. 2
0
def unrecognized_input_message(ARG_input):
    """Displays a message saying 'Sorry, ARG_input isn't a recognized command in this menu/dialog.'
    
    Parameters
    ----------
    ARG_input
        The input that was not recognized.
    """
    formatting.printwrap(
        f"Sorry, {ARG_input} isn't a recognized in this menu/dialog.")
    print()
Esempio n. 3
0
def general_program_message(ARG_string: str):
    """A generic message. Displays a textwrapped message, and then 'Press Enter to Continue.' The user can then press enter.

    Parameters
    ----------
    ARG_string : str
        The message contents to display.
    """
    print()
    formatting.printwrap(f"{ARG_string} Press 'Enter' to continue.")
    input()
Esempio n. 4
0
def warning_version_is_prerelease(ARG_major_version, ARG_minor_version,
                                  ARG_patch_version):
    """Displays a warning that this version is pre-release version.

    Parameters
    ----------
    ARG_major_version, ARG_minor_version, ARG_patch_version
        The components of the current version number.
    """
    formatting.printwrap(
        f"You are using Rosevomit version {ARG_major_version}.{ARG_minor_version}.{ARG_patch_version}. This software is actively under development. Proceed at your own risk."
    )
Esempio n. 5
0
def warning_version_is_prerelease_devbuild(ARG_major_version,
                                           ARG_minor_version,
                                           ARG_patch_version):
    """Displays a warning that this version is both a pre-release version and a development build.

    Parameters
    ----------
    ARG_major_version, ARG_minor_version, ARG_patch_version
        The components of the current version number.
    """
    formatting.printwrap(
        f"You are using a development build of Rosevomit {ARG_major_version}.{ARG_minor_version}.{ARG_patch_version}. This software is actively under development, and this development build may not be stable! Proceed at your own risk."
    )
Esempio n. 6
0
def filealreadyexists(ARG_filename) -> typing.Union[str, bool]:
    """Use this function when the user tries to save data using a name that already exists.

    Parameters
    ----------
    ARG_filename
        The filename that already exists.

    Returns
    -------
    str (new_filename) or bool
      This function returns 'True' if the user decides to keep the original file and delete the current data without saving it. This function returns 'False' if the user decides to overwrite the original file with the new data. If this function returns a string, this means that the user has decided to save data under a new filename.
    """
    formatting.printwrap(
        f"A file with the filename 'saved/{ARG_filename}' already exists. What should we do with the temporary file 'temp/{ARG_filename}'?"
    )
    formatting.printwrap(
        f"    1. Overwrite the old 'saved/{ARG_filename}' using 'temp/{ARG_filename}'"
    )
    formatting.printwrap(
        f"    2. Keep the old 'saved/{ARG_filename}' and delete 'temp/{ARG_filename}'"
    )
    formatting.printwrap(
        f"    3. Save 'temp/{ARG_filename}' under a new name.")
    _input = input("Choose an option: ")
    _input = _input.strip()
    if _input == "1":
        return False
    elif _input == "2":
        return True
    elif _input == "3":
        save_as = input("Enter new name: ")
        save_as = save_as.strip()
        if save_as == "":
            new_filename = "new-" + ARG_filename
        return new_filename
    else:
        messages.unrecognized_input_message(_input)
        recursive_result = filealreadyexists(ARG_filename)
        return recursive_result