It would be useful to set a different formatter between "normal" get_source and
source display.
Below a possible suggestion.
def get_source(self, class_name, method_name, formatter="null") :
if class_name not in self.classes :
return ""
lexer = get_lexer_by_name("java", stripall=True)
lexer.add_filter(MethodFilter(method_name=method_name))
formatter = NullFormatter()
if formatter != "null" :
formatter = TerminalFormatter()
result = highlight(self.classes[class_name], lexer, formatter)
return result
def display_source(self, class_name, method_name) :
print self.get_source( class_name, method_name, "terminal" )
Original issue reported on code.google.com by liadalex82@gmail.com on 23 Jul 2012 at 2:56
Original issue reported on code.google.com by
liadalex82@gmail.com
on 23 Jul 2012 at 2:56