#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
# mk1pass, Generate random strings for passwords.
# Copyright (C) 2023-2024 Mike Turkey All rights reserved.
# contact: voice[ATmark]miketurkey.com
# license: GPLv3 License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# ADDITIONAL MACHINE LEARNING PROHIBITION CLAUSE
#
# In addition to the rights granted under the applicable license(GPL-3),
# you are expressly prohibited from using any form of machine learning,
# artificial intelligence, or similar technologies to analyze, process,
# or extract information from this software, or to create derivative
# works based on this software.
#
# This prohibition includes, but is not limited to, training machine
# learning models, neural networks, or any other automated systems using
# the code or output of this software.
#
# The purpose of this prohibition is to protect the integrity and
# intended use of this software. If you wish to use this software for
# machine learning or similar purposes, you must seek explicit written
# permission from the copyright holder.
#
# see also 
#     GPL-3 Licence: https://www.gnu.org/licenses/gpl-3.0.html.en
#     Mike Turkey.com: https://miketurkey.com/

import sys
import unicodedata


class Print_Derivative(object):
    @staticmethod
    def print_stderr(*mes, end='\n', pyexit: int = 0):
        meses: list[str] = []
        meses = [unicodedata.normalize('NFD', s) for s in mes]
        [print(s, file=sys.stderr, end=end) for s in meses]
        if pyexit != 0:
            exit(pyexit)
        return

    @staticmethod
    def print_stdout(*mes, end='\n', file=sys.stdout):
        meses: list[str] = []
        meses = [unicodedata.normalize('NFD', s) for s in mes]
        [print(s, file=file, end=end) for s in meses]
        return


print_err = Print_Derivative.print_stderr
print_mes = Print_Derivative.print_stdout
