#NEWLINE# def __init__( self , path ) : #NEWLINE# #INDENT# if ( not os . path . exists ( path ) ) : #NEWLINE# #INDENT# raise ArchiveError ( "path doesn't exist: '{}'" . format ( path ) ) #NEWLINE# #UNINDENT# self . path = path #NEWLINE# ( _filebase , ext ) = os . path . splitext ( path ) #NEWLINE# if ( ext == '.gz' ) : #NEWLINE# #INDENT# self . fd = gzip . open ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( path == '.bz2' ) : #NEWLINE# #INDENT# self . fd = bz2 . BZ2File ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ext == '.xz' ) : #NEWLINE# #INDENT# self . fd = lzma . open ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fd = open ( path ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not is_vimball ( self . fd ) ) : #NEWLINE# #INDENT# raise ArchiveError ( 'invalid archive format' )