(self)
Cache extension modules and objects.
Cache extension modules and objects.
Cache extension modules and objects .
def _load_extensions(self):
        """Cache extension modules and objects."""
        if self._ext_funcs is not None:
            return
        if not self._extension:
            raise error.BASICError(error.STX)
        ext_objs = []
        for ext in self._extension:
            try:
                if isinstance(ext, (bytes, text_type)):
                    ext_objs.append(import_module(ext))
                else:
                    ext_objs.append(ext)
            except Exception as e:
                logging.error(u'Could not load extension module `%s`: %s', ext, repr(e))
                raise error.BASICError(error.INTERNAL_ERROR)
        self._ext_funcs = {
            n.upper().encode('ascii', 'ignore'): getattr(ext_obj, n)
            for ext_obj in ext_objs
            for n in dir(ext_obj) if not n.startswith('_')
        }
def _load_extensions ( self ) : if self . _ext_funcs is not None : return if not self . _extension : raise error . BASICError ( error . STX ) ext_objs = [ ] for ext in self . _extension : try : if isinstance ( ext , ( bytes , text_type ) ) : ext_objs . append ( import_module ( ext ) ) else : ext_objs . append ( ext ) except Exception as e : logging . error ( u'Could not load extension module `%s`: %s' , ext , repr ( e ) ) raise error . BASICError ( error . INTERNAL_ERROR ) self . _ext_funcs = { n . upper ( ) . encode ( 'ascii' , 'ignore' ) : getattr ( ext_obj , n ) for ext_obj in ext_objs for n in dir ( ext_obj ) if not n . startswith ( '_' ) }