#NEWLINE# def send_email( self , payload ) : #NEWLINE# #INDENT# if ( len ( self . commits ) == 1 ) : #NEWLINE# #INDENT# subj = ( '1 of your commits was merged into %s!' % payload [ 'repository' ] [ 'name' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# subj = ( '%s of your commits were merged into %s!' % ( len ( self . commits ) , payload [ 'repository' ] [ 'name' ] ) ) #NEWLINE# #UNINDENT# logging . debug ( ( 'Generated email subject [%s]' % subj ) ) #NEWLINE# if ( 'pusher' in payload ) : #NEWLINE# #INDENT# push_string = ( '%s by %s' % ( payload [ 'repository' ] [ 'name' ] , payload [ 'pusher' ] [ 'name' ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# push_string = ( '%s' % payload [ 'repository' ] [ 'name' ] ) #NEWLINE# #UNINDENT# body = ( '\n    Greetings, %s!\n\n    The following commits of yours have been pulled into %s.\n\n    Commits\n    -------\n    %s\n\n    -- The GitHub EmailHook\n   \t    ' % ( self . name , push_string , self . list_commits ( ) ) ) #NEWLINE# logging . debug ( ( 'About to email %s <%s> with info on %s commits (%s)' % ( self . name , self . email , len ( self . commits ) , self . list_commits ( ) ) ) ) #NEWLINE# mail . send_mail ( EMAIL_FROM , ( '%s <%s>' % ( self . name , self . email ) ) , subj , body )