##// END OF EJS Templates
Fix example usage of BaseFormatter.for_type_by_name....
Dan Allan -
Show More
@@ -85,7 +85,7 b' Formatters for third-party types'
85
85
86 The user can also register formatters for types without modifying the class::
86 The user can also register formatters for types without modifying the class::
87
87
88 from bar import Foo
88 from bar.baz import Foo
89
89
90 def foo_html(obj):
90 def foo_html(obj):
91 return '<marquee>Foo object %s</marquee>' % obj.name
91 return '<marquee>Foo object %s</marquee>' % obj.name
@@ -94,7 +94,7 b' The user can also register formatters for types without modifying the class::'
94 html_formatter.for_type(Foo, foo_html)
94 html_formatter.for_type(Foo, foo_html)
95
95
96 # Or register a type without importing it - this does the same as above:
96 # Or register a type without importing it - this does the same as above:
97 html_formatter.for_type_by_name('bar.Foo', foo_html)
97 html_formatter.for_type_by_name('bar.baz', 'Foo', foo_html)
98
98
99 Custom exception tracebacks
99 Custom exception tracebacks
100 ===========================
100 ===========================
General Comments 0
You need to be logged in to leave comments. Login now