def _get_changes(rsync_out):
 copied = list()
 deleted = list()
 for line in rsync_out.split('\n\n')[0].split('\n')[1:]:
  if line.startswith('deleting '):
   deleted.append(line.split(' ', 1)[(-1)])
  else:
   copied.append(line)
 return {'copied': (os.linesep.join(sorted(copied)) or 'N/A'), 'deleted': (os.linesep.join(sorted(deleted)) or 'N/A')}

def _get_changes ( rsync_out ) : copied = list ( ) deleted = list ( ) for line in rsync_out . split ( '\n\n' ) [ 0 ] . split ( '\n' ) [ 1 : ] : if line . startswith ( 'deleting ' ) : deleted . append ( line . split ( ' ' , 1 ) [ ( - 1 ) ] ) else : copied . append ( line ) return { 'copied' : ( os . linesep . join ( sorted ( copied ) ) or 'N/A' ) , 'deleted' : ( os . linesep . join ( sorted ( deleted ) ) or 'N/A' ) }
get changes from the rsync successfull output .