From 6ebd4c1e57eee1f8ed1e812c104579b8a8ee6769 Mon Sep 17 00:00:00 2001 From: Christopher Engelhard Date: Jul 21 2020 13:19:24 +0000 Subject: add hello-copr, a simple demo program --- diff --git a/src/hello_copr/__init__.py b/src/hello_copr/__init__.py new file mode 100644 index 0000000..6e19644 --- /dev/null +++ b/src/hello_copr/__init__.py @@ -0,0 +1,15 @@ +# This file is part of hello-copr . +# Copyright (C) 2020 Christopher Engelhard +# +# hello-copr 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. +# +# hello-copr 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 hello-copr. If not, see . diff --git a/src/hello_copr/colors.py b/src/hello_copr/colors.py new file mode 100644 index 0000000..169e830 --- /dev/null +++ b/src/hello_copr/colors.py @@ -0,0 +1,26 @@ +# This file is part of hello-copr . +# Copyright (C) 2020 Christopher Engelhard +# +# hello-copr 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. +# +# hello-copr 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 hello-copr. If not, see . + +from colorama import Fore, Style + +def red(arg): + return(Fore.RED + arg) + +def green(arg): + return(Fore.GREEN + arg) + +def normal(arg): + return(Style.RESET_ALL + arg) diff --git a/src/hello_copr/hello_copr.py b/src/hello_copr/hello_copr.py new file mode 100644 index 0000000..0e7ac62 --- /dev/null +++ b/src/hello_copr/hello_copr.py @@ -0,0 +1,31 @@ +# This file is part of hello-copr . +# Copyright (C) 2020 Christopher Engelhard +# +# hello-copr 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. +# +# hello-copr 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 hello-copr. If not, see . + +from colorama import init + +from hello_copr.colors import red, green, normal + +init() + +def hello(): + arg = red("Hello! ") + green("I'm the hello-copr demo program. ") + normal("I don't do much.") + return arg + +def main(): + print(hello()) + +if __name__ == "__main__": + main()