summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-ffcount.spec296
-rw-r--r--sources1
3 files changed, 298 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..4395bb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
+
+[![build](https://github.com/GjjvdBurg/ffcount/workflows/build/badge.svg)](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild)
+[![PyPI version](https://badge.fury.io/py/ffcount.svg)](https://pypi.org/project/ffcount)
+[![Python package downloads](https://pepy.tech/badge/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
+
+[![build](https://github.com/GjjvdBurg/ffcount/workflows/build/badge.svg)](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild)
+[![PyPI version](https://badge.fury.io/py/ffcount.svg)](https://pypi.org/project/ffcount)
+[![Python package downloads](https://pepy.tech/badge/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
+
+[![build](https://github.com/GjjvdBurg/ffcount/workflows/build/badge.svg)](https://github.com/GjjvdBurg/ffcount/actions?query=workflow%3Abuild)
+[![PyPI version](https://badge.fury.io/py/ffcount.svg)](https://pypi.org/project/ffcount)
+[![Python package downloads](https://pepy.tech/badge/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
diff --git a/sources b/sources
new file mode 100644
index 0000000..f4d3d64
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+af23fe4a009633eab15c391b1bbb8e06 ffcount-0.2.1.tar.gz