%if 0%{?fedora} %global with_python3 1 %{!?py3ver: %global py3ver %(%{__python3} -c "import sys ; print(sys.version[:3])")} %endif %{!?py2ver: %global py2ver %(%{__python} -c "import sys ; print sys.version[:3]")} %global modname logging_tree Name: python-logging-tree Version: 1.1 Release: 1%{?dist} Summary: Introspect and display the logger tree inside "logging" Group: Development/Libraries License: BSD URL: http://pypi.python.org/pypi/%{modname} Source0: http://pypi.python.org/packages/source/l/%{modname}/%{modname}-%{version}.tar.gz # Upstream patch is here - https://github.com/brandon-rhodes/logging_tree/pull/3 Patch0: logging_tree-Support-tests-on-python3.3.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-nose %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-nose %endif %description Introspection for the ``logging`` logger tree in the Standard Library. While you can write programs that call this package's ``tree()`` function and examine the hierarchy of logger objects that it finds inside of the Standard Library ``logging`` module, the simplest use of this package for debugging is to call ``printout()`` to print the loggers, filters, and handlers that your application has configured:: >>> logging.getLogger('a') >>> logging.getLogger('a.b').setLevel(logging.DEBUG) >>> logging.getLogger('x.c') >>> from logging_tree import printout >>> printout() "" Level WARNING | o<--"a" | | | o<--"a.b" | Level DEBUG | o<--[x] | o<--"x.c" %if 0%{?with_python3} %package -n python3-logging-tree Summary: Introspect and display the logger tree inside "logging" Group: Development/Libraries %description -n python3-logging-tree Introspection for the ``logging`` logger tree in the Standard Library. While you can write programs that call this package's ``tree()`` function and examine the hierarchy of logger objects that it finds inside of the Standard Library ``logging`` module, the simplest use of this package for debugging is to call ``printout()`` to print the loggers, filters, and handlers that your application has configured:: >>> logging.getLogger('a') >>> logging.getLogger('a.b').setLevel(logging.DEBUG) >>> logging.getLogger('x.c') >>> from logging_tree import printout >>> printout() "" Level WARNING | o<--"a" | | | o<--"a.b" | Level DEBUG | o<--[x] | o<--"x.c" %endif %prep %setup -q -n %{modname}-%{version} %patch0 -p1 -b .python3.3 # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root=%{buildroot} popd %endif %{__python} setup.py install -O1 --skip-build --root=%{buildroot} %check %{__python} -m unittest discover logging_tree %if 0%{?with_python3} pushd %{py3dir} %{__python3} -m unittest discover logging_tree popd %endif %files # There is no LICENSE or README shipped with the package. # There are docstrings in the code itself, though. # https://github.com/brandon-rhodes/logging_tree/pull/1 %{python_sitelib}/%{modname}/ %{python_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-logging-tree %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}-* %endif %changelog * Mon Dec 03 2012 Ralph Bean - 1.1-1 - Initial package for Fedora