User:Mstone/Tricks: Difference between revisions

From OLPC
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
== Verbose Python Tracebacks ==
==== Verbose Python Tracebacks ====


[http://teach.laptop.org/~mstone/nice_traces.py nice_traces.py]
[http://teach.laptop.org/~mstone/nice_traces.py nice_traces.py]
Line 6: Line 6:
# also, trace(sys.exc_info()) can be used for more controlled handling
# also, trace(sys.exc_info()) can be used for more controlled handling


== Handy report() function ==
==== Handy report() function ====


See [http://dev.laptop.org/git?p=projects/mocktools;a=blob;f=trac_helper.py;hb=HEAD trac_helper.py]
See [http://dev.laptop.org/git?p=projects/mocktools;a=blob;f=trac_helper.py;hb=HEAD trac_helper.py]


== Relational error logging ==
==== Relational error logging ====


See [http://dev.laptop.org/git?p=projects/mocktools;a=blob;f=trac_helper.py;hb=HEAD trac_helper.py] and [http://dev.laptop.org/git?p=projects/buildtools;a=blob;f=collect-pkgs.py;hb=HEAD collect-pkgs.py].
See [http://dev.laptop.org/git?p=projects/mocktools;a=blob;f=trac_helper.py;hb=HEAD trac_helper.py] and [http://dev.laptop.org/git?p=projects/buildtools;a=blob;f=collect-pkgs.py;hb=HEAD collect-pkgs.py].


== Email-based error reporting ==
==== Email-based error reporting ====


See [http://dev.laptop.org/git?p=projects/buildtools;a=blob;f=email_warnings.py;hb=HEAD email_warnings.py].
See [http://dev.laptop.org/git?p=projects/buildtools;a=blob;f=email_warnings.py;hb=HEAD email_warnings.py].


== RPM Makefiles ==
==== RPM Makefiles ====


See [http://dev.laptop.org/git?p=users/mstone/rpm-packaging;a=tree rpm-packaging] as well as individual projects like [http://dev.laptop.org/git/projects/olpc-netutils] along with my [[Developer/Fedora#Outside Reading|Fedora packaging bibliography]].
See [http://dev.laptop.org/git?p=users/mstone/rpm-packaging;a=tree rpm-packaging] as well as individual projects like [http://dev.laptop.org/git/projects/olpc-netutils] along with my [[Developer/Fedora#Outside Reading|Fedora packaging bibliography]].


== [https://launchpad.net/pymeta pymeta] parser-based controllers ==
==== [https://launchpad.net/pymeta pymeta] parser-based controllers ====


See [http://dev.laptop.org/git?p=users/mstone/triagebot;a=blob;f=grammar.py;hb=grammar triagebot] for cute tricks.
See [http://dev.laptop.org/git?p=users/mstone/triagebot;a=blob;f=grammar.py;hb=grammar triagebot] for cute tricks.


== Python GDB Macros ==
==== Python GDB Macros ====


http://wiki.python.org/moin/DebuggingWithGdb
http://wiki.python.org/moin/DebuggingWithGdb

==== Tree-based python context management ====

[http://dev.laptop.org/git?p=users/mstone/puritan;a=blob;f=main.py;hb=f9#l16 puritan's main.py]

Revision as of 00:38, 24 September 2008

Verbose Python Tracebacks

 nice_traces.py
 from nice_traces import trace
 # sys.excepthook now is set to trace by the import
 # also, trace(sys.exc_info()) can be used for more controlled handling

Handy report() function

 See trac_helper.py

Relational error logging

 See trac_helper.py and collect-pkgs.py.

Email-based error reporting

 See email_warnings.py.

RPM Makefiles

 See rpm-packaging as well as individual projects like [1] along with my Fedora packaging bibliography.

pymeta parser-based controllers

 See triagebot for cute tricks.

Python GDB Macros

 http://wiki.python.org/moin/DebuggingWithGdb

Tree-based python context management

puritan's main.py