#NEWLINE# def _check_diff( cat_name , base_path ) : #NEWLINE# #INDENT# '\n    Output the approximate number of changed/added strings in the en catalog.\n    ' #NEWLINE# po_path = ( '%(path)s/en/LC_MESSAGES/django%(ext)s.po' % { #NEWLINE# #INDENT# 'path' : base_path , #NEWLINE# 'ext' : ( 'js' if cat_name . endswith ( '-js' ) else '' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# p = Popen ( ( "git diff -U0 %s | egrep -v '^@@|^[-+]#|^..POT-Creation' | wc -l" % po_path ) , stdout = PIPE , stderr = PIPE , shell = True ) #NEWLINE# ( output , errors ) = p . communicate ( ) #NEWLINE# num_changes = ( int ( output . strip ( ) ) - 4 ) #NEWLINE# print ( ( "%d changed/added messages in '%s' catalog." % ( num_changes , cat_name ) ) )