%global _empty_manifest_terminate_build 0 Name: python-antipathy Version: 0.85.3 Release: 1 Summary: oo view of file paths and names, subclassed from bytes/str/unicode License: BSD License URL: https://github.com/ethanfurman/antipathy Source0: https://mirrors.nju.edu.cn/pypi/web/packages/eb/ac/eee1077d5b607e3c3e22e65f98d5d2bdffc712047e3839220c2ad18dfe64/antipathy-0.85.3.tar.gz BuildArch: noarch %description Tired of calling a function for every path manipulation you need to do? Is:: >>> path, filename = os.path.split(some_name) >>> basename, ext = os.path.splitext(filename) >>> basename = basename + '_01' >>> new_name = os.path.join(path, basename+ext) wearing on your nerves? In short, are you filled with antipathy [1] for os.path? Then get antipathy and work with Path:: >>> from antipathy import Path >>> some_name = Path('/home/ethan/source/my_file.txt') >>> backups = Path('/home/ethan/backup/') >>> print some_name.path '/home/ethan/source/' >>> print some_name.ext '.txt' >>> print some_name.exists() True # (well, if it happens to exist at this moment ;) >>> backup = backups / some_name.filename + '_01' + some_name.ext >>> print backup '/home/ethan/backup/my_file_01.txt' >>> some_name.copy(backup) Because Path is a subclass of bytes/str/unicode, it can still be passed to other functions that expect a bytes/str/unicode object and work seamlessly [2]. [1] https://www.google.com/#q=antipathy [2] in most cases -- there are a few places that do a `type` check instead of an `isinstance` check. %package -n python3-antipathy Summary: oo view of file paths and names, subclassed from bytes/str/unicode Provides: python-antipathy BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-antipathy Tired of calling a function for every path manipulation you need to do? Is:: >>> path, filename = os.path.split(some_name) >>> basename, ext = os.path.splitext(filename) >>> basename = basename + '_01' >>> new_name = os.path.join(path, basename+ext) wearing on your nerves? In short, are you filled with antipathy [1] for os.path? Then get antipathy and work with Path:: >>> from antipathy import Path >>> some_name = Path('/home/ethan/source/my_file.txt') >>> backups = Path('/home/ethan/backup/') >>> print some_name.path '/home/ethan/source/' >>> print some_name.ext '.txt' >>> print some_name.exists() True # (well, if it happens to exist at this moment ;) >>> backup = backups / some_name.filename + '_01' + some_name.ext >>> print backup '/home/ethan/backup/my_file_01.txt' >>> some_name.copy(backup) Because Path is a subclass of bytes/str/unicode, it can still be passed to other functions that expect a bytes/str/unicode object and work seamlessly [2]. [1] https://www.google.com/#q=antipathy [2] in most cases -- there are a few places that do a `type` check instead of an `isinstance` check. %package help Summary: Development documents and examples for antipathy Provides: python3-antipathy-doc %description help Tired of calling a function for every path manipulation you need to do? Is:: >>> path, filename = os.path.split(some_name) >>> basename, ext = os.path.splitext(filename) >>> basename = basename + '_01' >>> new_name = os.path.join(path, basename+ext) wearing on your nerves? In short, are you filled with antipathy [1] for os.path? Then get antipathy and work with Path:: >>> from antipathy import Path >>> some_name = Path('/home/ethan/source/my_file.txt') >>> backups = Path('/home/ethan/backup/') >>> print some_name.path '/home/ethan/source/' >>> print some_name.ext '.txt' >>> print some_name.exists() True # (well, if it happens to exist at this moment ;) >>> backup = backups / some_name.filename + '_01' + some_name.ext >>> print backup '/home/ethan/backup/my_file_01.txt' >>> some_name.copy(backup) Because Path is a subclass of bytes/str/unicode, it can still be passed to other functions that expect a bytes/str/unicode object and work seamlessly [2]. [1] https://www.google.com/#q=antipathy [2] in most cases -- there are a few places that do a `type` check instead of an `isinstance` check. %prep %autosetup -n antipathy-0.85.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-antipathy -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 0.85.3-1 - Package Spec generated