diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-12 06:30:29 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 06:30:29 +0000 |
commit | 3da9768c740234d781fb5c6c1d2d87179d654188 (patch) | |
tree | 0f0343803c9d24fb95db92ea57f6e1ceb6aecc8c | |
parent | 0158ff0162b3dc5d763cfcc6dd4f416ca6de73ff (diff) |
automatic import of python-string-coloropeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-string-color.spec | 375 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 377 insertions, 0 deletions
@@ -0,0 +1 @@ +/string-color-1.2.3.tar.gz diff --git a/python-string-color.spec b/python-string-color.spec new file mode 100644 index 0000000..fbd92c1 --- /dev/null +++ b/python-string-color.spec @@ -0,0 +1,375 @@ +%global _empty_manifest_terminate_build 0 +Name: python-string-color +Version: 1.2.3 +Release: 1 +Summary: just another mod to print strings in 256 colors in the terminal. +License: MIT License +URL: https://gitlab.com/shindagger/string-color +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1d/92/2da4fc020730eccfa9f3955638bbfc1fd4fab379a8f0541fa3a708278ccf/string-color-1.2.3.tar.gz +BuildArch: noarch + +Requires: python3-setuptools +Requires: python3-columnar +Requires: python3-colorama + +%description +# string-color + +string-color is just another python module for coloring strings in print statements. + +### Installation + +`$ pip install string-color` + +### Python Module Usage + +```python +from stringcolor import * + +# a few examples without background colors. +# for color names see CLI usage below. +print(cs("here we go", "orchid")) +print(cs("away to space!", "DeepPink3")) +print(cs("final fantasy", "#ffff87")) +print() + +# bold and underline also available. +print(cs("purple number 4, bold", "purple4").bold()) +print(cs("blue, underlined", "blue").underline()) +print(bold("bold AND underlined!").underline().cs("red", "gold")) +print(underline("the bottom line.")) +print() + +# yellow text with a red background. +# color names, hex values, and ansi numbers will work. +print(cs("warning!", "yellow", "#ff0000")) +print() + +# concat +print(cs("wild", "pink")+" stuff") +print("nothing "+cs("something", "DarkViolet2", "lightgrey6")) +print() + +# use any working rgb or hex values. +# it will find the closest color available. +print(cs("this will show up red", "#ff0009")) +print(cs("so will this", "rgb(254, 0, 1)")) +print() + +# use with format and f-strings +print(f"this is a test {cs('to check formatting with f-strings', 'yellow', 'grey').bold().underline()}") +print("this is a test {}".format(cs('to check the format function', 'purple', 'lightgrey11').bold().underline())) +``` + +![Usage Screep Cap][screencap] + +[screencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap.jpg "Usage Screen Cap" + +### CLI Usage + +``` +usage: string-color [-h] [-x] [-r] [-t] [--hsl] [-a] [-i] [-v] [color] + +just another mod for printing strings in color. + +positional arguments: + color show info for a specific color: + $ string-color red + $ string-color '#ffff87' + $ string-color *grey* # wildcards acceptable + $ string-color '#E16A7F' # any hex not found will return the closest match + +optional arguments: + -h, --help show this help message and exit + -x, --hex show hex values + -r, --rgb show rgb values + -t, --term show term numbers + --hsl show hsl values + -a, --alpha sort by name + -i, --inverse show inverse colors + -v, --version show program's version number and exit +``` + +`$ string-color` + +display a list of all 256 colors + +`$ string-color yellow` + +show color info for the color yellow + +`$ string-color "#ff0000"` + +show color info for the hex value #ff0000 + +`$ string-color *grey*` + +show all colors with "grey" in the name. also works with "grey\*" and "\*grey" + +![CLI Screep Cap][cliscreencap] + +[cliscreencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap2.jpg "CLI Screen Cap" + + + + + + +%package -n python3-string-color +Summary: just another mod to print strings in 256 colors in the terminal. +Provides: python-string-color +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-string-color +# string-color + +string-color is just another python module for coloring strings in print statements. + +### Installation + +`$ pip install string-color` + +### Python Module Usage + +```python +from stringcolor import * + +# a few examples without background colors. +# for color names see CLI usage below. +print(cs("here we go", "orchid")) +print(cs("away to space!", "DeepPink3")) +print(cs("final fantasy", "#ffff87")) +print() + +# bold and underline also available. +print(cs("purple number 4, bold", "purple4").bold()) +print(cs("blue, underlined", "blue").underline()) +print(bold("bold AND underlined!").underline().cs("red", "gold")) +print(underline("the bottom line.")) +print() + +# yellow text with a red background. +# color names, hex values, and ansi numbers will work. +print(cs("warning!", "yellow", "#ff0000")) +print() + +# concat +print(cs("wild", "pink")+" stuff") +print("nothing "+cs("something", "DarkViolet2", "lightgrey6")) +print() + +# use any working rgb or hex values. +# it will find the closest color available. +print(cs("this will show up red", "#ff0009")) +print(cs("so will this", "rgb(254, 0, 1)")) +print() + +# use with format and f-strings +print(f"this is a test {cs('to check formatting with f-strings', 'yellow', 'grey').bold().underline()}") +print("this is a test {}".format(cs('to check the format function', 'purple', 'lightgrey11').bold().underline())) +``` + +![Usage Screep Cap][screencap] + +[screencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap.jpg "Usage Screen Cap" + +### CLI Usage + +``` +usage: string-color [-h] [-x] [-r] [-t] [--hsl] [-a] [-i] [-v] [color] + +just another mod for printing strings in color. + +positional arguments: + color show info for a specific color: + $ string-color red + $ string-color '#ffff87' + $ string-color *grey* # wildcards acceptable + $ string-color '#E16A7F' # any hex not found will return the closest match + +optional arguments: + -h, --help show this help message and exit + -x, --hex show hex values + -r, --rgb show rgb values + -t, --term show term numbers + --hsl show hsl values + -a, --alpha sort by name + -i, --inverse show inverse colors + -v, --version show program's version number and exit +``` + +`$ string-color` + +display a list of all 256 colors + +`$ string-color yellow` + +show color info for the color yellow + +`$ string-color "#ff0000"` + +show color info for the hex value #ff0000 + +`$ string-color *grey*` + +show all colors with "grey" in the name. also works with "grey\*" and "\*grey" + +![CLI Screep Cap][cliscreencap] + +[cliscreencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap2.jpg "CLI Screen Cap" + + + + + + +%package help +Summary: Development documents and examples for string-color +Provides: python3-string-color-doc +%description help +# string-color + +string-color is just another python module for coloring strings in print statements. + +### Installation + +`$ pip install string-color` + +### Python Module Usage + +```python +from stringcolor import * + +# a few examples without background colors. +# for color names see CLI usage below. +print(cs("here we go", "orchid")) +print(cs("away to space!", "DeepPink3")) +print(cs("final fantasy", "#ffff87")) +print() + +# bold and underline also available. +print(cs("purple number 4, bold", "purple4").bold()) +print(cs("blue, underlined", "blue").underline()) +print(bold("bold AND underlined!").underline().cs("red", "gold")) +print(underline("the bottom line.")) +print() + +# yellow text with a red background. +# color names, hex values, and ansi numbers will work. +print(cs("warning!", "yellow", "#ff0000")) +print() + +# concat +print(cs("wild", "pink")+" stuff") +print("nothing "+cs("something", "DarkViolet2", "lightgrey6")) +print() + +# use any working rgb or hex values. +# it will find the closest color available. +print(cs("this will show up red", "#ff0009")) +print(cs("so will this", "rgb(254, 0, 1)")) +print() + +# use with format and f-strings +print(f"this is a test {cs('to check formatting with f-strings', 'yellow', 'grey').bold().underline()}") +print("this is a test {}".format(cs('to check the format function', 'purple', 'lightgrey11').bold().underline())) +``` + +![Usage Screep Cap][screencap] + +[screencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap.jpg "Usage Screen Cap" + +### CLI Usage + +``` +usage: string-color [-h] [-x] [-r] [-t] [--hsl] [-a] [-i] [-v] [color] + +just another mod for printing strings in color. + +positional arguments: + color show info for a specific color: + $ string-color red + $ string-color '#ffff87' + $ string-color *grey* # wildcards acceptable + $ string-color '#E16A7F' # any hex not found will return the closest match + +optional arguments: + -h, --help show this help message and exit + -x, --hex show hex values + -r, --rgb show rgb values + -t, --term show term numbers + --hsl show hsl values + -a, --alpha sort by name + -i, --inverse show inverse colors + -v, --version show program's version number and exit +``` + +`$ string-color` + +display a list of all 256 colors + +`$ string-color yellow` + +show color info for the color yellow + +`$ string-color "#ff0000"` + +show color info for the hex value #ff0000 + +`$ string-color *grey*` + +show all colors with "grey" in the name. also works with "grey\*" and "\*grey" + +![CLI Screep Cap][cliscreencap] + +[cliscreencap]: https://believe-it-or-not-im-walking-on-air.s3.amazonaws.com/sc-screen-cap2.jpg "CLI Screen Cap" + + + + + + +%prep +%autosetup -n string-color-1.2.3 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-string-color -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.3-1 +- Package Spec generated @@ -0,0 +1 @@ +c1e655d0685290def910612bb2dab09e string-color-1.2.3.tar.gz |