#NEWLINE# def _get_files( self , path_spec ) : #NEWLINE# #INDENT# if ( not isinstance ( path_spec , six . string_types ) ) : #NEWLINE# #INDENT# self . _filepaths = sorted ( list ( path_spec ) , key = natural_keys ) #NEWLINE# self . _count = len ( path_spec ) #NEWLINE# return #NEWLINE# #UNINDENT# if zipfile . is_zipfile ( path_spec ) : #NEWLINE# #INDENT# self . _is_zipfile = True #NEWLINE# self . pathname = os . path . abspath ( path_spec ) #NEWLINE# self . _zipfile = zipfile . ZipFile ( path_spec , 'r' ) #NEWLINE# filepaths = [ fn for fn in self . _zipfile . namelist ( ) if fnmatch . fnmatch ( fn , '*.*' ) ] #NEWLINE# self . _filepaths = sorted ( filepaths , key = natural_keys ) #NEWLINE# self . _count = len ( self . _filepaths ) #NEWLINE# if ( ( 'plugin' in self . kwargs ) and ( self . kwargs [ 'plugin' ] is not None ) ) : #NEWLINE# #INDENT# warn ( 'A plugin cannot be combined with reading from an archive. Extract it if you want to use the plugin.' ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# self . pathname = os . path . abspath ( path_spec ) #NEWLINE# if os . path . isdir ( path_spec ) : #NEWLINE# #INDENT# warn ( "Loading ALL files in this directory. To ignore extraneous files, use a pattern like 'path/to/images/*.png'" , UserWarning ) #NEWLINE# directory = path_spec #NEWLINE# filenames = os . listdir ( directory ) #NEWLINE# make_full_path = ( lambda filename : os . path . abspath ( os . path . join ( directory , filename ) ) ) #NEWLINE# filepaths = list ( map ( make_full_path , filenames ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filepaths = glob . glob ( path_spec ) #NEWLINE# #UNINDENT# self . _filepaths = sorted ( filepaths , key = natural_keys ) #NEWLINE# self . _count = len ( self . _filepaths ) #NEWLINE# if ( self . _count == 0 ) : #NEWLINE# #INDENT# raise IOError ( 'No files were found matching that path.' )