#NEWLINE# def to_json( self ) : #NEWLINE# #INDENT# patches = self . patches ( ) #NEWLINE# if ( len ( patches ) == 0 ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# patch_str = '' #NEWLINE# for patch in patches : #NEWLINE# #INDENT# patch_str += str ( patch ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'id' : self . buf [ 'id' ] , #NEWLINE# 'md5_after' : self . md5_after , #NEWLINE# 'md5_before' : self . md5_before , #NEWLINE# 'path' : self . buf [ 'path' ] , #NEWLINE# 'patch' : patch_str , #NEWLINE# 'name' : 'patch' , #NEWLINE# #UNINDENT# }