#NEWLINE# def _get_author( self , value ) : #NEWLINE# #INDENT# match = re . match ( '^(.+) <([^>]+)>$' , value ) #NEWLINE# if ( not name ) : #NEWLINE# #INDENT# if ( '@' in value ) : #NEWLINE# #INDENT# ( name , email ) = ( value , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( name , email ) = ( value , '{0}@localhost' . format ( value ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( name , email ) = ( match . group ( 1 ) , match . group ( 2 ) ) #NEWLINE# #UNINDENT# ( author , _ ) = get_or_create ( Author , where = { #NEWLINE# #INDENT# 'email' : email , #NEWLINE# #UNINDENT# } , defaults = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# #UNINDENT# } ) #NEWLINE# return author