def rar_sort(a, b):
 aext = a.split('.')[(-1)]
 bext = b.split('.')[(-1)]
 if ((aext == 'rar') and (bext == 'rar')):
  return cmp(a, b)
 elif (aext == 'rar'):
  return (-1)
 elif (bext == 'rar'):
  return 1
 else:
  return cmp(a, b)

def rar_sort ( a , b ) : aext = a . split ( '.' ) [ ( - 1 ) ] bext = b . split ( '.' ) [ ( - 1 ) ] if ( ( aext == 'rar' ) and ( bext == 'rar' ) ) : return cmp ( a , b ) elif ( aext == 'rar' ) : return ( - 1 ) elif ( bext == 'rar' ) : return 1 else : return cmp ( a , b )
define sort method for rar file names .