#NEWLINE# def splitext( path ) : #NEWLINE# #INDENT# 'Like os.path.splitext, but take off .tar too' #NEWLINE# ( base , ext ) = posixpath . splitext ( path ) #NEWLINE# if base . lower ( ) . endswith ( '.tar' ) : #NEWLINE# #INDENT# ext = ( base [ ( - 4 ) : ] + ext ) #NEWLINE# base = base [ : ( - 4 ) ] #NEWLINE# #UNINDENT# return ( base , ext )