#NEWLINE# def _get_extensions( self ) : #NEWLINE# #INDENT# pathname = os . path . join ( self . dirname , self . filename ) #NEWLINE# name_ver = ( '%s-%s' % ( self . name , arcname . version ) ) #NEWLINE# info_dir = ( '%s.dist-info' % name_ver ) #NEWLINE# arcname = posixpath . join ( info_dir , 'EXTENSIONS' ) #NEWLINE# wrapper = codecs . getreader ( 'utf-8' ) #NEWLINE# result = [ ] #NEWLINE# with ZipFile ( pathname , 'r' ) as zf : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# with zf . open ( arcname ) as bf : #NEWLINE# #INDENT# wf = wrapper ( bf ) #NEWLINE# extensions = json . load ( wf ) #NEWLINE# cache = self . _get_dylib_cache ( ) #NEWLINE# prefix = cache . prefix_to_dir ( pathname ) #NEWLINE# cache_base = os . path . join ( cache . base , prefix ) #NEWLINE# if ( not os . path . isdir ( cache_base ) ) : #NEWLINE# #INDENT# os . makedirs ( cache_base ) #NEWLINE# #UNINDENT# for ( name , relpath ) in extensions . items ( ) : #NEWLINE# #INDENT# dest = os . path . join ( cache_base , convert_path ( relpath ) ) #NEWLINE# if ( not os . path . exists ( dest ) ) : #NEWLINE# #INDENT# extract = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# file_time = os . stat ( dest ) . st_mtime #NEWLINE# file_time = datetime . datetime . fromtimestamp ( file_time ) #NEWLINE# info = zf . getinfo ( relpath ) #NEWLINE# wheel_time = datetime . datetime ( * info . date_time ) #NEWLINE# extract = ( wheel_time > file_time ) #NEWLINE# #UNINDENT# if extract : #NEWLINE# #INDENT# zf . extract ( relpath , cache_base ) #NEWLINE# #UNINDENT# result . append ( ( name , dest ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return result