diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 08:57:02 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 08:57:02 +0000 |
| commit | 63b0f881d1e8ebbcc6558a39afc8886678a6d9f7 (patch) | |
| tree | 1b6a19b149fe59e5d66f778b20b2f6991cf80906 | |
| parent | bd3c2a46693c1b0af5a657aa701c7a3cc10d17bc (diff) | |
automatic import of python-ffcount
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-ffcount.spec | 296 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 298 insertions, 0 deletions
@@ -0,0 +1 @@ +/ffcount-0.2.1.tar.gz diff --git a/python-ffcount.spec b/python-ffcount.spec new file mode 100644 index 0000000..2838a6f --- /dev/null +++ b/python-ffcount.spec @@ -0,0 +1,296 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ffcount +Version: 0.2.1 +Release: 1 +Summary: Fast File Count: Recursively count files and directories very quickly +License: Apache License 2.0 +URL: https://github.com/GjjvdBurg/ffcount +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3a/a9/d725482760e69807853729b1619c58f8aa7a41898b93d272de3a77de0e10/ffcount-0.2.1.tar.gz + + +%description + +# Fast File Count in Python + +[](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild) +[](https://pypi.org/project/ffcount) +[](https://pepy.tech/project/ffcount) + +This is a Python package to quickly count the number of files and directories +in a given path. Optionally you can count recursively and include hidden files +in the total. + +This package is a wrapper around ``fast-file-count`` by [Christopher Schultz +](https://github.com/ChristopherSchultz). Credit for the initial version +belongs to Christopher Schultz, I wrote the Python wrapper, converted the +Windows code to use builtin functionality, and packaged it up. See the file +``src/c_count.c`` for the other contributors and see the commit history of +this package on GitHub for my exact changes. + +## Installation + +Installation can be done easily with pip: + +```bash +$ pip install ffcount +``` + +## Usage + +There is a command line application called ``ffcount``, which recursively +counts files and directories: + +``` +$ ffcount +``` + +See ``ffcount -h`` for options. + +The package can also be used as a Python library, using the ``ffcount`` +function. This function returns a tuple ``(number_of_files, number_of_dirs)`` +and it can be used as follows: + +```python +>>> from ffcount import ffcount + +# count everything under the current path +>>> ffcount() +(521013, 43012) + +# count without hidden files +>>> ffcount(hidden=False) +(234012, 12082) + +# use a different path +>>> ffcount('/tmp') +(81, 10) +``` + +Note that ``ffcount`` counts links as files, even if they point to a +directory. In some cases, this explains the discrepancy with other ways of +counting. + +To obtain the full function documentation, simply run: + +```python +>>> import ffcount +>>> help(ffcount) +``` + +## License + +The original C code by Christopher Schultz was licensed under the Apache +License 2.0. This package is therefore licensed under this license as well. + + + + +%package -n python3-ffcount +Summary: Fast File Count: Recursively count files and directories very quickly +Provides: python-ffcount +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-ffcount + +# Fast File Count in Python + +[](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild) +[](https://pypi.org/project/ffcount) +[](https://pepy.tech/project/ffcount) + +This is a Python package to quickly count the number of files and directories +in a given path. Optionally you can count recursively and include hidden files +in the total. + +This package is a wrapper around ``fast-file-count`` by [Christopher Schultz +](https://github.com/ChristopherSchultz). Credit for the initial version +belongs to Christopher Schultz, I wrote the Python wrapper, converted the +Windows code to use builtin functionality, and packaged it up. See the file +``src/c_count.c`` for the other contributors and see the commit history of +this package on GitHub for my exact changes. + +## Installation + +Installation can be done easily with pip: + +```bash +$ pip install ffcount +``` + +## Usage + +There is a command line application called ``ffcount``, which recursively +counts files and directories: + +``` +$ ffcount +``` + +See ``ffcount -h`` for options. + +The package can also be used as a Python library, using the ``ffcount`` +function. This function returns a tuple ``(number_of_files, number_of_dirs)`` +and it can be used as follows: + +```python +>>> from ffcount import ffcount + +# count everything under the current path +>>> ffcount() +(521013, 43012) + +# count without hidden files +>>> ffcount(hidden=False) +(234012, 12082) + +# use a different path +>>> ffcount('/tmp') +(81, 10) +``` + +Note that ``ffcount`` counts links as files, even if they point to a +directory. In some cases, this explains the discrepancy with other ways of +counting. + +To obtain the full function documentation, simply run: + +```python +>>> import ffcount +>>> help(ffcount) +``` + +## License + +The original C code by Christopher Schultz was licensed under the Apache +License 2.0. This package is therefore licensed under this license as well. + + + + +%package help +Summary: Development documents and examples for ffcount +Provides: python3-ffcount-doc +%description help + +# Fast File Count in Python + +[](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild) +[](https://pypi.org/project/ffcount) +[](https://pepy.tech/project/ffcount) + +This is a Python package to quickly count the number of files and directories +in a given path. Optionally you can count recursively and include hidden files +in the total. + +This package is a wrapper around ``fast-file-count`` by [Christopher Schultz +](https://github.com/ChristopherSchultz). Credit for the initial version +belongs to Christopher Schultz, I wrote the Python wrapper, converted the +Windows code to use builtin functionality, and packaged it up. See the file +``src/c_count.c`` for the other contributors and see the commit history of +this package on GitHub for my exact changes. + +## Installation + +Installation can be done easily with pip: + +```bash +$ pip install ffcount +``` + +## Usage + +There is a command line application called ``ffcount``, which recursively +counts files and directories: + +``` +$ ffcount +``` + +See ``ffcount -h`` for options. + +The package can also be used as a Python library, using the ``ffcount`` +function. This function returns a tuple ``(number_of_files, number_of_dirs)`` +and it can be used as follows: + +```python +>>> from ffcount import ffcount + +# count everything under the current path +>>> ffcount() +(521013, 43012) + +# count without hidden files +>>> ffcount(hidden=False) +(234012, 12082) + +# use a different path +>>> ffcount('/tmp') +(81, 10) +``` + +Note that ``ffcount`` counts links as files, even if they point to a +directory. In some cases, this explains the discrepancy with other ways of +counting. + +To obtain the full function documentation, simply run: + +```python +>>> import ffcount +>>> help(ffcount) +``` + +## License + +The original C code by Christopher Schultz was licensed under the Apache +License 2.0. This package is therefore licensed under this license as well. + + + + +%prep +%autosetup -n ffcount-0.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-ffcount -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.1-1 +- Package Spec generated @@ -0,0 +1 @@ +af23fe4a009633eab15c391b1bbb8e06 ffcount-0.2.1.tar.gz |
