summaryrefslogtreecommitdiff
path: root/python-simple-chalk.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-simple-chalk.spec')
-rw-r--r--python-simple-chalk.spec525
1 files changed, 525 insertions, 0 deletions
diff --git a/python-simple-chalk.spec b/python-simple-chalk.spec
new file mode 100644
index 0000000..7b77698
--- /dev/null
+++ b/python-simple-chalk.spec
@@ -0,0 +1,525 @@
+%global _empty_manifest_terminate_build 0
+Name: python-simple-chalk
+Version: 0.1.0
+Release: 1
+Summary: A terminal string styling library
+License: WTFNMFPL-1.0
+URL: https://github.com/olsonpm/py_simple-chalk
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/31/97/b8114a347aee340570eb92b1a1fe512a038766903af7aa4e28447dc25c80/simple_chalk-0.1.0.tar.gz
+BuildArch: noarch
+
+
+%description
+## Simple Chalk
+
+*Note: This document is best viewed [on github](github.com/olsonpm/py_simple-chalk).
+Pypi's headers are all caps which presents inaccurate information*"
+
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**
+
+- [Intro](#intro)
+ - [What is it?](#what-is-it)
+ - [Why create it?](#why-create-it)
+ - [Why the subset of features?](#why-the-subset-of-features)
+- [Install](#install)
+- [Usage](#usage)
+- [Api](#api)
+ - [`chalk` (string) => string](#chalk-string--string)
+ - [`newChalk` () => Chalk](#newchalk---chalk)
+- [Test](#test)
+- [Features included from js version of Chalk](#features-included-from-js-version-of-chalk)
+- [Features omitted](#features-omitted)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+
+### Intro
+
+##### What is it?
+
+A terminal string styling library for python. It implements a subset of
+Sindre Sorhus' [chalk](https://github.com/chalk/chalk) (which is for js).
+
+e.g. `chalk.green.bold("success")` prints like you'd expect in the console.
+
+##### Why create it?
+
+I am familiar with and enjoy the syntax of [chalk](https://github.com/chalk/chalk).
+Anthonyalmarza's [chalk](https://github.com/anthonyalmarza/chalk)
+deviates from that syntax and so I created my own.
+
+I'm also new to python so this was a good way to learn.
+
+
+##### Why the subset of features?
+
+I only use chalk for very simple purposes so I left out things like 256 colors.
+
+
+### Install
+
+```sh
+$ pip install simple_chalk
+```
+
+
+### Usage
+
+```python
+from simple_chalk import chalk, green
+
+# both of these are the same
+print(chalk.green("success"))
+print(green("success"))
+
+# chained
+print(green.bold("success"))
+
+# assign combinations
+success = green.bold.underline
+print(success("we did it!"))
+
+# last color wins
+print(green.red("this is red"))
+
+# background and foreground colors are separate
+whyNot = green.bgWhite.red.bgGray
+print(whyNot("this is red text with a gray background"))
+```
+
+
+### Api
+
+`simple_chalk` exports the following
+
+##### `chalk` (string) => string
+ - A singleton that can be used instead of importing the colors and
+ styles directly.
+ - `chalk` and all exported colors/styles are chainable callables. When called,
+ they take a single string argument and return a string wrapped in the
+ appropriate ascii color codes.
+
+##### `newChalk` () => Chalk
+ - You probably don't need this, but it creates a new chalk instance in case
+ another library is misbehaving.
+
+The following colors are exported
+
+- black
+- red
+- green
+- yellow
+- blue
+- magenta
+- cyan
+- white
+- blackBright (also 'gray' and 'grey')
+- redBright
+- greenBright
+- yellowBright
+- blueBright
+- magentaBright
+- cyanBright
+- whiteBright
+
+Each color also has a camel-cased `bg` equivalent. e.g. `bgBlack`
+and `bgYellowBright`
+
+Finally the following miscellaneous styles are exported
+
+- bold
+- dim
+- underline
+- hidden
+
+
+### Test
+
+```sh
+hub clone olsonpm/py_simple-chalk
+cd py_simple-chalk
+python runTests.py
+```
+
+
+### Features included from js version of Chalk
+
+- chainable api
+- same color names (with added aliases)
+
+
+### Features omitted
+
+\*\* Features marked with `*` are ones I'd pull in should someone create a PR.
+
+- 256 colors and TrueColor support
+- multiple arguments, and thus nested styles
+- \*color support detection
+- \*blue -> blueBright auto conversion on windows
+- \*ability to disable
+- \*modifiers other than the miscellaneous styles noted above.
+ e.g. `reset`, `italic`, `inverse` etc.
+
+%package -n python3-simple-chalk
+Summary: A terminal string styling library
+Provides: python-simple-chalk
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-simple-chalk
+## Simple Chalk
+
+*Note: This document is best viewed [on github](github.com/olsonpm/py_simple-chalk).
+Pypi's headers are all caps which presents inaccurate information*"
+
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**
+
+- [Intro](#intro)
+ - [What is it?](#what-is-it)
+ - [Why create it?](#why-create-it)
+ - [Why the subset of features?](#why-the-subset-of-features)
+- [Install](#install)
+- [Usage](#usage)
+- [Api](#api)
+ - [`chalk` (string) => string](#chalk-string--string)
+ - [`newChalk` () => Chalk](#newchalk---chalk)
+- [Test](#test)
+- [Features included from js version of Chalk](#features-included-from-js-version-of-chalk)
+- [Features omitted](#features-omitted)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+
+### Intro
+
+##### What is it?
+
+A terminal string styling library for python. It implements a subset of
+Sindre Sorhus' [chalk](https://github.com/chalk/chalk) (which is for js).
+
+e.g. `chalk.green.bold("success")` prints like you'd expect in the console.
+
+##### Why create it?
+
+I am familiar with and enjoy the syntax of [chalk](https://github.com/chalk/chalk).
+Anthonyalmarza's [chalk](https://github.com/anthonyalmarza/chalk)
+deviates from that syntax and so I created my own.
+
+I'm also new to python so this was a good way to learn.
+
+
+##### Why the subset of features?
+
+I only use chalk for very simple purposes so I left out things like 256 colors.
+
+
+### Install
+
+```sh
+$ pip install simple_chalk
+```
+
+
+### Usage
+
+```python
+from simple_chalk import chalk, green
+
+# both of these are the same
+print(chalk.green("success"))
+print(green("success"))
+
+# chained
+print(green.bold("success"))
+
+# assign combinations
+success = green.bold.underline
+print(success("we did it!"))
+
+# last color wins
+print(green.red("this is red"))
+
+# background and foreground colors are separate
+whyNot = green.bgWhite.red.bgGray
+print(whyNot("this is red text with a gray background"))
+```
+
+
+### Api
+
+`simple_chalk` exports the following
+
+##### `chalk` (string) => string
+ - A singleton that can be used instead of importing the colors and
+ styles directly.
+ - `chalk` and all exported colors/styles are chainable callables. When called,
+ they take a single string argument and return a string wrapped in the
+ appropriate ascii color codes.
+
+##### `newChalk` () => Chalk
+ - You probably don't need this, but it creates a new chalk instance in case
+ another library is misbehaving.
+
+The following colors are exported
+
+- black
+- red
+- green
+- yellow
+- blue
+- magenta
+- cyan
+- white
+- blackBright (also 'gray' and 'grey')
+- redBright
+- greenBright
+- yellowBright
+- blueBright
+- magentaBright
+- cyanBright
+- whiteBright
+
+Each color also has a camel-cased `bg` equivalent. e.g. `bgBlack`
+and `bgYellowBright`
+
+Finally the following miscellaneous styles are exported
+
+- bold
+- dim
+- underline
+- hidden
+
+
+### Test
+
+```sh
+hub clone olsonpm/py_simple-chalk
+cd py_simple-chalk
+python runTests.py
+```
+
+
+### Features included from js version of Chalk
+
+- chainable api
+- same color names (with added aliases)
+
+
+### Features omitted
+
+\*\* Features marked with `*` are ones I'd pull in should someone create a PR.
+
+- 256 colors and TrueColor support
+- multiple arguments, and thus nested styles
+- \*color support detection
+- \*blue -> blueBright auto conversion on windows
+- \*ability to disable
+- \*modifiers other than the miscellaneous styles noted above.
+ e.g. `reset`, `italic`, `inverse` etc.
+
+%package help
+Summary: Development documents and examples for simple-chalk
+Provides: python3-simple-chalk-doc
+%description help
+## Simple Chalk
+
+*Note: This document is best viewed [on github](github.com/olsonpm/py_simple-chalk).
+Pypi's headers are all caps which presents inaccurate information*"
+
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**
+
+- [Intro](#intro)
+ - [What is it?](#what-is-it)
+ - [Why create it?](#why-create-it)
+ - [Why the subset of features?](#why-the-subset-of-features)
+- [Install](#install)
+- [Usage](#usage)
+- [Api](#api)
+ - [`chalk` (string) => string](#chalk-string--string)
+ - [`newChalk` () => Chalk](#newchalk---chalk)
+- [Test](#test)
+- [Features included from js version of Chalk](#features-included-from-js-version-of-chalk)
+- [Features omitted](#features-omitted)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+
+### Intro
+
+##### What is it?
+
+A terminal string styling library for python. It implements a subset of
+Sindre Sorhus' [chalk](https://github.com/chalk/chalk) (which is for js).
+
+e.g. `chalk.green.bold("success")` prints like you'd expect in the console.
+
+##### Why create it?
+
+I am familiar with and enjoy the syntax of [chalk](https://github.com/chalk/chalk).
+Anthonyalmarza's [chalk](https://github.com/anthonyalmarza/chalk)
+deviates from that syntax and so I created my own.
+
+I'm also new to python so this was a good way to learn.
+
+
+##### Why the subset of features?
+
+I only use chalk for very simple purposes so I left out things like 256 colors.
+
+
+### Install
+
+```sh
+$ pip install simple_chalk
+```
+
+
+### Usage
+
+```python
+from simple_chalk import chalk, green
+
+# both of these are the same
+print(chalk.green("success"))
+print(green("success"))
+
+# chained
+print(green.bold("success"))
+
+# assign combinations
+success = green.bold.underline
+print(success("we did it!"))
+
+# last color wins
+print(green.red("this is red"))
+
+# background and foreground colors are separate
+whyNot = green.bgWhite.red.bgGray
+print(whyNot("this is red text with a gray background"))
+```
+
+
+### Api
+
+`simple_chalk` exports the following
+
+##### `chalk` (string) => string
+ - A singleton that can be used instead of importing the colors and
+ styles directly.
+ - `chalk` and all exported colors/styles are chainable callables. When called,
+ they take a single string argument and return a string wrapped in the
+ appropriate ascii color codes.
+
+##### `newChalk` () => Chalk
+ - You probably don't need this, but it creates a new chalk instance in case
+ another library is misbehaving.
+
+The following colors are exported
+
+- black
+- red
+- green
+- yellow
+- blue
+- magenta
+- cyan
+- white
+- blackBright (also 'gray' and 'grey')
+- redBright
+- greenBright
+- yellowBright
+- blueBright
+- magentaBright
+- cyanBright
+- whiteBright
+
+Each color also has a camel-cased `bg` equivalent. e.g. `bgBlack`
+and `bgYellowBright`
+
+Finally the following miscellaneous styles are exported
+
+- bold
+- dim
+- underline
+- hidden
+
+
+### Test
+
+```sh
+hub clone olsonpm/py_simple-chalk
+cd py_simple-chalk
+python runTests.py
+```
+
+
+### Features included from js version of Chalk
+
+- chainable api
+- same color names (with added aliases)
+
+
+### Features omitted
+
+\*\* Features marked with `*` are ones I'd pull in should someone create a PR.
+
+- 256 colors and TrueColor support
+- multiple arguments, and thus nested styles
+- \*color support detection
+- \*blue -> blueBright auto conversion on windows
+- \*ability to disable
+- \*modifiers other than the miscellaneous styles noted above.
+ e.g. `reset`, `italic`, `inverse` etc.
+
+%prep
+%autosetup -n simple-chalk-0.1.0
+
+%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-simple-chalk -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.0-1
+- Package Spec generated