#NEWLINE# def main( ) : #NEWLINE# #INDENT# p = subprocess . Popen ( [ 'git' , 'status' ] , stdout = subprocess . PIPE ) #NEWLINE# ( out , err ) = p . communicate ( ) #NEWLINE# modifieds = modified . findall ( out . decode ( ) ) #NEWLINE# news = new . findall ( out . decode ( ) ) #NEWLINE# modifieds += err #NEWLINE# rrcode = 0 #NEWLINE# for file in set ( modifieds ) : #NEWLINE# #INDENT# p = subprocess . Popen ( [ 'pep8' , '--ignore=E501' , file ] , stdout = subprocess . PIPE ) #NEWLINE# ( pep8_out , err ) = p . communicate ( ) #NEWLINE# p = subprocess . Popen ( [ 'pyflakes' , file ] , stdout = subprocess . PIPE ) #NEWLINE# ( pyflakes_out , err ) = p . communicate ( ) #NEWLINE# if ( pep8_out or pyflakes_out ) : #NEWLINE# #INDENT# if pep8_out : #NEWLINE# #INDENT# print ( pep8_out . decode ( ) ) #NEWLINE# #UNINDENT# if pyflakes_out : #NEWLINE# #INDENT# print ( pyflakes_out . decode ( ) ) #NEWLINE# #UNINDENT# rrcode = 1 #NEWLINE# #UNINDENT# #UNINDENT# sys . exit ( rrcode )