diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 07:44:22 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 07:44:22 +0000 |
commit | f923163d3539c11529f6b18428485876e0e38df7 (patch) | |
tree | b4c44f490f779516700078117914f88034c90011 | |
parent | 3cf2432eeeeee60a47a927ef94a56d0497d44577 (diff) |
automatic import of python-newlifeutils
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-newlifeutils.spec | 380 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 382 insertions, 0 deletions
@@ -0,0 +1 @@ +/NewLifeUtils-5.2.1.tar.gz diff --git a/python-newlifeutils.spec b/python-newlifeutils.spec new file mode 100644 index 0000000..7bf31c8 --- /dev/null +++ b/python-newlifeutils.spec @@ -0,0 +1,380 @@ +%global _empty_manifest_terminate_build 0 +Name: python-NewLifeUtils +Version: 5.2.1 +Release: 1 +Summary: View changelog.txt at https://raw.githubusercontent.com/NewLife1324/NewLifeUtils-Dev/main/CHANGELOG.txt +License: MIT +URL: https://github.com/NewLife1324/NewLifeUtils-Dev +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1d/54/59423ce9fda4a88268efa51c5339f7df93137edd7f4389e1f1beb5850e8b/NewLifeUtils-5.2.1.tar.gz +BuildArch: noarch + +Requires: python3-PyYAML +Requires: python3-requests + +%description +## stats + + + + + + + + +[](https://github.com/NewLifeUtils/NewLifeUtils-Dev/issues) +[](http://inch-ci.org/github/NewLifeUtils/NewLifeUtils-Dev) + +## Contact me +[PyPI Page](https://pypi.org/project/NewLifeUtils) + +[My website](http://newlife-learn.h1n.ru) + +[My VK](https://vk.com/newlife2019_szhs) + +My Mail: semechkagent@gmail.com + +## News +Recently, the code was rewritten, but without using notepad. I was able to understand and get used to PyCharm, which means that refactoring and quick code writing functions became available to me. This has greatly simplified the work and revealed a lot of bugs in my code, which means that my code is far from perfect and I have something to strive for. In any case, I have fixed quite important flaws in my code and partially rewritten my code once again. It's easier for me to start from scratch than to redo ВЇ\_(гѓ„)_/ВЇ + +## Modules +- ColorModule +- LoggerModule +- ExceptModule +- FileModule +- StringUtilModule +- TableBuildModule +- UtilsModule +- CustomShellModule +- DatabaseManageModule (working) +### ColorModule + +```py +from NewLifeUtils.ColorModule import FGC, ACC + +print(f'{FGC.RED}Red text') +print(f'{FGC.GREEN}Green text') +print(f'{ACC.UNDERLINE}UNDERLINE') +print(f'{ACC.RESET}No formating') +``` + +### LoggerModule + + +```py +from NewLifeUtils.LoggerModule import log, wrn, err, tip, rea + +a = rea('input your data:') +log('My Event') +wrn('Something is wrong') +err('I broke something.') +tip('Tip #1, I recommend it to you...') +log('Event with tag', 'my tag') +``` + +### ExceptModule + +```py +from NewLifeUtils.ExceptModule import except_print + +try: + a = [1,2,3] + a[3] +except Exception as e: + except_print(e,"fatal", tb=True) #Not more working +``` + +### StringUtilModule + +```py +from NewLifeUtils.StringUtilModule import screate,remove_csi +from NewLifeUtils.ColorModule import FGC, ACC + +text = f'{FGC.RED}r{FGC.GREEN}g{FGC.BLUE}b{ACC.RESET}' +print(f'Original: {text}') +print('|'+screate(text, size=10, insert="r", filler_symbol=" ")+'| - right 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol=" ")+'| - left 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol="@")+'| - left 10 ("@")') +print(remove_csi(text)) +``` + +### TableBuildModule + +```py +from NewLifeUtils.TableBuildModule import * +data = [ + "header", "header number 2", "num", + "data","tooooooooooooooooo long string", "123", + "data2", "small","15436" + ] +table = create_table(3,[],data) +print(table) +``` + + +***Translator used** + + + + +%package -n python3-NewLifeUtils +Summary: View changelog.txt at https://raw.githubusercontent.com/NewLife1324/NewLifeUtils-Dev/main/CHANGELOG.txt +Provides: python-NewLifeUtils +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-NewLifeUtils +## stats + + + + + + + + +[](https://github.com/NewLifeUtils/NewLifeUtils-Dev/issues) +[](http://inch-ci.org/github/NewLifeUtils/NewLifeUtils-Dev) + +## Contact me +[PyPI Page](https://pypi.org/project/NewLifeUtils) + +[My website](http://newlife-learn.h1n.ru) + +[My VK](https://vk.com/newlife2019_szhs) + +My Mail: semechkagent@gmail.com + +## News +Recently, the code was rewritten, but without using notepad. I was able to understand and get used to PyCharm, which means that refactoring and quick code writing functions became available to me. This has greatly simplified the work and revealed a lot of bugs in my code, which means that my code is far from perfect and I have something to strive for. In any case, I have fixed quite important flaws in my code and partially rewritten my code once again. It's easier for me to start from scratch than to redo ВЇ\_(гѓ„)_/ВЇ + +## Modules +- ColorModule +- LoggerModule +- ExceptModule +- FileModule +- StringUtilModule +- TableBuildModule +- UtilsModule +- CustomShellModule +- DatabaseManageModule (working) +### ColorModule + +```py +from NewLifeUtils.ColorModule import FGC, ACC + +print(f'{FGC.RED}Red text') +print(f'{FGC.GREEN}Green text') +print(f'{ACC.UNDERLINE}UNDERLINE') +print(f'{ACC.RESET}No formating') +``` + +### LoggerModule + + +```py +from NewLifeUtils.LoggerModule import log, wrn, err, tip, rea + +a = rea('input your data:') +log('My Event') +wrn('Something is wrong') +err('I broke something.') +tip('Tip #1, I recommend it to you...') +log('Event with tag', 'my tag') +``` + +### ExceptModule + +```py +from NewLifeUtils.ExceptModule import except_print + +try: + a = [1,2,3] + a[3] +except Exception as e: + except_print(e,"fatal", tb=True) #Not more working +``` + +### StringUtilModule + +```py +from NewLifeUtils.StringUtilModule import screate,remove_csi +from NewLifeUtils.ColorModule import FGC, ACC + +text = f'{FGC.RED}r{FGC.GREEN}g{FGC.BLUE}b{ACC.RESET}' +print(f'Original: {text}') +print('|'+screate(text, size=10, insert="r", filler_symbol=" ")+'| - right 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol=" ")+'| - left 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol="@")+'| - left 10 ("@")') +print(remove_csi(text)) +``` + +### TableBuildModule + +```py +from NewLifeUtils.TableBuildModule import * +data = [ + "header", "header number 2", "num", + "data","tooooooooooooooooo long string", "123", + "data2", "small","15436" + ] +table = create_table(3,[],data) +print(table) +``` + + +***Translator used** + + + + +%package help +Summary: Development documents and examples for NewLifeUtils +Provides: python3-NewLifeUtils-doc +%description help +## stats + + + + + + + + +[](https://github.com/NewLifeUtils/NewLifeUtils-Dev/issues) +[](http://inch-ci.org/github/NewLifeUtils/NewLifeUtils-Dev) + +## Contact me +[PyPI Page](https://pypi.org/project/NewLifeUtils) + +[My website](http://newlife-learn.h1n.ru) + +[My VK](https://vk.com/newlife2019_szhs) + +My Mail: semechkagent@gmail.com + +## News +Recently, the code was rewritten, but without using notepad. I was able to understand and get used to PyCharm, which means that refactoring and quick code writing functions became available to me. This has greatly simplified the work and revealed a lot of bugs in my code, which means that my code is far from perfect and I have something to strive for. In any case, I have fixed quite important flaws in my code and partially rewritten my code once again. It's easier for me to start from scratch than to redo ВЇ\_(гѓ„)_/ВЇ + +## Modules +- ColorModule +- LoggerModule +- ExceptModule +- FileModule +- StringUtilModule +- TableBuildModule +- UtilsModule +- CustomShellModule +- DatabaseManageModule (working) +### ColorModule + +```py +from NewLifeUtils.ColorModule import FGC, ACC + +print(f'{FGC.RED}Red text') +print(f'{FGC.GREEN}Green text') +print(f'{ACC.UNDERLINE}UNDERLINE') +print(f'{ACC.RESET}No formating') +``` + +### LoggerModule + + +```py +from NewLifeUtils.LoggerModule import log, wrn, err, tip, rea + +a = rea('input your data:') +log('My Event') +wrn('Something is wrong') +err('I broke something.') +tip('Tip #1, I recommend it to you...') +log('Event with tag', 'my tag') +``` + +### ExceptModule + +```py +from NewLifeUtils.ExceptModule import except_print + +try: + a = [1,2,3] + a[3] +except Exception as e: + except_print(e,"fatal", tb=True) #Not more working +``` + +### StringUtilModule + +```py +from NewLifeUtils.StringUtilModule import screate,remove_csi +from NewLifeUtils.ColorModule import FGC, ACC + +text = f'{FGC.RED}r{FGC.GREEN}g{FGC.BLUE}b{ACC.RESET}' +print(f'Original: {text}') +print('|'+screate(text, size=10, insert="r", filler_symbol=" ")+'| - right 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol=" ")+'| - left 10 (" ")') +print('|'+screate(text, size=10, insert="l", filler_symbol="@")+'| - left 10 ("@")') +print(remove_csi(text)) +``` + +### TableBuildModule + +```py +from NewLifeUtils.TableBuildModule import * +data = [ + "header", "header number 2", "num", + "data","tooooooooooooooooo long string", "123", + "data2", "small","15436" + ] +table = create_table(3,[],data) +print(table) +``` + + +***Translator used** + + + + +%prep +%autosetup -n NewLifeUtils-5.2.1 + +%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-NewLifeUtils -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 5.2.1-1 +- Package Spec generated @@ -0,0 +1 @@ +15db6b40d5ba340550a3ed30ac4caed0 NewLifeUtils-5.2.1.tar.gz |