bluemira.base.look_and_feel =========================== .. py:module:: bluemira.base.look_and_feel .. autoapi-nested-parse:: Aesthetic and ambiance functions. Attributes ---------- .. autoapisummary:: bluemira.base.look_and_feel.LOGGER bluemira.base.look_and_feel.LOCAL_LINES bluemira.base.look_and_feel.BLUEMIRA_ASCII Functions --------- .. autoapisummary:: bluemira.base.look_and_feel.get_git_version bluemira.base.look_and_feel.get_git_branch bluemira.base.look_and_feel.get_git_files bluemira.base.look_and_feel.get_platform bluemira.base.look_and_feel.count_slocs bluemira.base.look_and_feel.bluemira_critical bluemira.base.look_and_feel.bluemira_error bluemira.base.look_and_feel.bluemira_warn bluemira.base.look_and_feel.bluemira_print bluemira.base.look_and_feel.bluemira_debug bluemira.base.look_and_feel._bluemira_clean_flush bluemira.base.look_and_feel.bluemira_print_flush bluemira.base.look_and_feel.bluemira_debug_flush bluemira.base.look_and_feel.bluemira_print_clean bluemira.base.look_and_feel.bluemira_error_clean bluemira.base.look_and_feel.print_banner bluemira.base.look_and_feel.version_banner bluemira.base.look_and_feel.user_banner Module Contents --------------- .. py:data:: LOGGER .. py:data:: LOCAL_LINES .. py:function:: get_git_version(directory: str) -> str Get the version string of the current git branch, e.g.: '0.0.3-74-g70d48be'. :param directory: The full path directory of the folder to get git information from :returns: The git version bytestring :rtype: str .. py:function:: get_git_branch(directory: str) -> str Get the name of the current git branch, e.g. 'develop'. :param directory: The full path directory of the folder to get git information from :returns: The git branch string :rtype: str .. py:function:: get_git_files(directory: str, branch: str) -> list[str] Get the names of the files in the directory of the specified branch name. :param directory: The full path directory of the folder to get git information from :param branch: The name of the git branch to retrieve the filenames from :returns: The list of git-controlled path strings :rtype: list[str] .. py:function:: get_platform() -> str Get the OS platform. :returns: The generic name of the platform (e.g. Linux, Windows) :rtype: str .. py:function:: count_slocs(directory: str, branch: str, exts: list[str] | None = None, ignore: list[str] | None = None) -> dict[str, int | list[int]] Counts lines of code within a given directory for a given git branch :param directory: The full path directory of the folder to get git information from :param branch: The git branch string :param exts: The list of file extensions to search the directory for :param ignore: The list of extensions and filenames to ignore :returns: The dictionary of number of lines of code per file extension, and the total linecount :rtype: dict[str, int | list[int]] .. py:function:: bluemira_critical(string: str, *, stacklevel: int = 4) Standard template for bluemira critical errors. :param string: The string to log at critical level .. py:function:: bluemira_error(string: str, *, stacklevel: int = 4) Standard template for bluemira errors. :param string: The string to log at error level .. py:function:: bluemira_warn(string: str, *, stacklevel: int = 4) Standard template for bluemira warnings. :param string: The string to log at warning level .. py:function:: bluemira_print(string: str, *, stacklevel: int = 4) Standard template for bluemira information messages. :param string: The string to log at info level .. py:function:: bluemira_debug(string: str, *, stacklevel: int = 4) Standard template for bluemira debugging. :param string: The string to log at debug level .. py:function:: _bluemira_clean_flush(string: str, *, stacklevel: int = 4, progress_timeout: float = 4) Print and flush string. Useful for updating information. :param string: The string to colour flush print .. py:function:: bluemira_print_flush(string: str, *, stacklevel: int = 4, progress_timeout: float = 4) Print a coloured, boxed line to the console and flushes it. Useful for updating information. :param string: The string to colour flush print .. py:function:: bluemira_debug_flush(string: str, *, stacklevel: int = 4, progress_timeout: float = 4) Print a coloured, boxed line to the console and flushes it. Useful for updating information when running at the debug logging level. :param string: The string to colour flush print for debug messages. .. py:function:: bluemira_print_clean(string: str, *, stacklevel: int = 4) Print to the logging info console with no modification. Useful for external programs :param string: The string to print .. py:function:: bluemira_error_clean(string: str, *, stacklevel: int = 4) Print to the logging error console, colouring the output red. No other modification is made. Useful for external programs :param string: The string to colour print .. py:data:: BLUEMIRA_ASCII :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ _ _ _ | | | | (_) | |__ | |_ _ ___ _ __ ___ _ _ __ __ _ __ | '_ \| | | | |/ _ \ '_ ` _ \| | '__/ _| |_ \ | |_) | | |_| | __/ | | | | | | | | (_| |_) | |_.__/|_|\__,_|\___|_| |_| |_|_|_| \__|_|__/ """ .. raw:: html
.. py:function:: print_banner() Print the initial banner to the console upon running the bluemira code. .. py:function:: version_banner() -> list[str] Get the string for the version banner. :returns: The list of strings of text describing the version and code information :rtype: list[str] .. py:function:: user_banner() -> list[str] Get user and platform info and create text to print to banner. :returns: The text for the banner containing user and platform information :rtype: list[str]