%global _empty_manifest_terminate_build 0 Name: python-pd Version: 0.0.4 Release: 1 Summary: more detailed python backtraces (similar to backtrace module) License: BSD URL: https://github.com/MoserMichael/visual-python-strace Source0: https://mirrors.nju.edu.cn/pypi/web/packages/06/4b/8fffdc88c8f2d9e9b1727b99f1c6da7a10b9726f227fdb71270e7adc057c/pd-0.0.4.tar.gz BuildArch: noarch %description ## visual stack trace for python utilities for debugging of python scripts. prints stack backtraces that look similar to gdb stacktrace (gdb commands bt and bt full); can be used instead of traceback. Written by Michael Moser (c) 2015 this project on pypi [link](https://test.pypi.org/project/pd/) Functions ``` die(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does not follow objects (follow_objects = 0); exit program with error (status 1) this is similar to die built in function in perl die2(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does follow objects (follow_objects = 1); exit program with error (status 1) this is similar to die built in function in perl print_exception_ex(follow_objects=0, file=None) prints an exception with more detailed stack trace, is used as follows: the function is similar to traceback.print_exception , just with more detailed stack trace import pd try: except BaseException: pd.print_exception_ex() parameters: follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) example stack trace: Exception: got it #1 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 1) at test_pd.py:29 Calls next frame at: raise Exception('got it') at: test_pd.py:29 #2 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 2) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #3 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 3) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #4 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 4) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #5 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 5) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #6 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 6) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #7 def main() at test_pd.py:44 Local variables: n = {'a': 42, 'b': [1, 2, 3, 4]} Calls next frame at: pd.print_exception_ex( follow_objects = 1 ) at: test_pd.py:44 print_stack_ex(skipframes=0, follow_objects=0, file=None, frame=None) print stack trace from an arbitrary point in the program; the function is similar to traceback.print_stack , just with more detailed stack trace the stack trace includes function names, values of parameters and values of local variables. i find it easier to debug with this stack trace. parameters: skipframes - skip a number of frames if is not 0 (default 0) follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) frame - specify a start frame (default None - show from calling function; deepest frame on top marked with #1) this function is similar to traceback.print_stack , just with more detailed stack trace. works for python 2.7, should work for other versions as well example stack trace: #1 def fact(n = 1) at test_pd.py:10 Local variables: loc 2 loc2 [0] Calls next frame at: pd.print_stack_ex() at: test_pd.py:10 #2 def fact(n = 2) at test_pd.py:8 Local variables: loc 4 loc2 [0, 1] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #3 def fact(n = 3) at test_pd.py:8 Local variables: loc 6 loc2 [0, 1, 2] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #4 def fact(n = 4) at test_pd.py:8 Local variables: loc 8 loc2 [0, 1, 2, 3] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #5 def main() at test_pd.py:36 Local variables: Calls next frame at: print fact(4) at: test_pd.py:36 #6 def () at test_pd.py:53 Calls next frame at: main() at: test_pd.py:53 ``` %package -n python3-pd Summary: more detailed python backtraces (similar to backtrace module) Provides: python-pd BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-pd ## visual stack trace for python utilities for debugging of python scripts. prints stack backtraces that look similar to gdb stacktrace (gdb commands bt and bt full); can be used instead of traceback. Written by Michael Moser (c) 2015 this project on pypi [link](https://test.pypi.org/project/pd/) Functions ``` die(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does not follow objects (follow_objects = 0); exit program with error (status 1) this is similar to die built in function in perl die2(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does follow objects (follow_objects = 1); exit program with error (status 1) this is similar to die built in function in perl print_exception_ex(follow_objects=0, file=None) prints an exception with more detailed stack trace, is used as follows: the function is similar to traceback.print_exception , just with more detailed stack trace import pd try: except BaseException: pd.print_exception_ex() parameters: follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) example stack trace: Exception: got it #1 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 1) at test_pd.py:29 Calls next frame at: raise Exception('got it') at: test_pd.py:29 #2 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 2) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #3 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 3) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #4 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 4) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #5 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 5) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #6 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 6) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #7 def main() at test_pd.py:44 Local variables: n = {'a': 42, 'b': [1, 2, 3, 4]} Calls next frame at: pd.print_exception_ex( follow_objects = 1 ) at: test_pd.py:44 print_stack_ex(skipframes=0, follow_objects=0, file=None, frame=None) print stack trace from an arbitrary point in the program; the function is similar to traceback.print_stack , just with more detailed stack trace the stack trace includes function names, values of parameters and values of local variables. i find it easier to debug with this stack trace. parameters: skipframes - skip a number of frames if is not 0 (default 0) follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) frame - specify a start frame (default None - show from calling function; deepest frame on top marked with #1) this function is similar to traceback.print_stack , just with more detailed stack trace. works for python 2.7, should work for other versions as well example stack trace: #1 def fact(n = 1) at test_pd.py:10 Local variables: loc 2 loc2 [0] Calls next frame at: pd.print_stack_ex() at: test_pd.py:10 #2 def fact(n = 2) at test_pd.py:8 Local variables: loc 4 loc2 [0, 1] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #3 def fact(n = 3) at test_pd.py:8 Local variables: loc 6 loc2 [0, 1, 2] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #4 def fact(n = 4) at test_pd.py:8 Local variables: loc 8 loc2 [0, 1, 2, 3] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #5 def main() at test_pd.py:36 Local variables: Calls next frame at: print fact(4) at: test_pd.py:36 #6 def () at test_pd.py:53 Calls next frame at: main() at: test_pd.py:53 ``` %package help Summary: Development documents and examples for pd Provides: python3-pd-doc %description help ## visual stack trace for python utilities for debugging of python scripts. prints stack backtraces that look similar to gdb stacktrace (gdb commands bt and bt full); can be used instead of traceback. Written by Michael Moser (c) 2015 this project on pypi [link](https://test.pypi.org/project/pd/) Functions ``` die(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does not follow objects (follow_objects = 0); exit program with error (status 1) this is similar to die built in function in perl die2(*msg) receives a variable number of arguments; prints each argument (with pprint) to standard error stream, shows a detailed stack trace (also to standard error, see print_stack_ex, does follow objects (follow_objects = 1); exit program with error (status 1) this is similar to die built in function in perl print_exception_ex(follow_objects=0, file=None) prints an exception with more detailed stack trace, is used as follows: the function is similar to traceback.print_exception , just with more detailed stack trace import pd try: except BaseException: pd.print_exception_ex() parameters: follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) example stack trace: Exception: got it #1 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 1) at test_pd.py:29 Calls next frame at: raise Exception('got it') at: test_pd.py:29 #2 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 2) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #3 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 3) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #4 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 4) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #5 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 5) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #6 def kuku2(self = {'a': 42, 'b': [1, 2, 3, 4]}, depth = 6) at test_pd.py:28 Calls next frame at: kuku2( depth - 1 ) at: test_pd.py:28 #7 def main() at test_pd.py:44 Local variables: n = {'a': 42, 'b': [1, 2, 3, 4]} Calls next frame at: pd.print_exception_ex( follow_objects = 1 ) at: test_pd.py:44 print_stack_ex(skipframes=0, follow_objects=0, file=None, frame=None) print stack trace from an arbitrary point in the program; the function is similar to traceback.print_stack , just with more detailed stack trace the stack trace includes function names, values of parameters and values of local variables. i find it easier to debug with this stack trace. parameters: skipframes - skip a number of frames if is not 0 (default 0) follow_objects - if not 0 then representation of object values is printed Please note that follow_objects=1 can generate a lot of output, and can take a lot of time. (default 0) file - print to file (default value None - print to standard error stream) frame - specify a start frame (default None - show from calling function; deepest frame on top marked with #1) this function is similar to traceback.print_stack , just with more detailed stack trace. works for python 2.7, should work for other versions as well example stack trace: #1 def fact(n = 1) at test_pd.py:10 Local variables: loc 2 loc2 [0] Calls next frame at: pd.print_stack_ex() at: test_pd.py:10 #2 def fact(n = 2) at test_pd.py:8 Local variables: loc 4 loc2 [0, 1] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #3 def fact(n = 3) at test_pd.py:8 Local variables: loc 6 loc2 [0, 1, 2] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #4 def fact(n = 4) at test_pd.py:8 Local variables: loc 8 loc2 [0, 1, 2, 3] Calls next frame at: return n * fact( n - 1 ) at: test_pd.py:8 #5 def main() at test_pd.py:36 Local variables: Calls next frame at: print fact(4) at: test_pd.py:36 #6 def () at test_pd.py:53 Calls next frame at: main() at: test_pd.py:53 ``` %prep %autosetup -n pd-0.0.4 %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-pd -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon May 15 2023 Python_Bot - 0.0.4-1 - Package Spec generated