def _get_source(self, fullmodname):
        """
        Internal helper for load_module().

        Args:
          fullmodname: The dot-separated full module name, e.g. 'django.core.mail'.

        Returns:
          A tuple (submodname, is_package, fullpath, source) where:
            submodname: The final component of the module name, e.g. 'mail'.
            is_package: A bool indicating whether this is a package.
            fullpath: The path to the module's source code including the
              zipfile's or tarfile's filename.
            source: The module's source code.

        Raises:
          ImportError if the module is not found in the archive.
        """

        submodname, is_package, relpath, fileobj = self._get_info(fullmodname)
        fullpath = '%s%s%s' % (fileobj, os.sep, relpath)
        if isinstance(fileobj, zipfile.ZipFile):
            source = fileobj.read(relpath.replace(os.sep, '/'))
        elif isinstance(fileobj, tarfile.TarFile):
            source = fileobj.extractfile(relpath.replace(os.sep, '/')).read()
        elif isinstance(fileobj, dict):
            source = fileobj[relpath.replace(os.sep, '/')].read()
        else:
            source = open(fileobj[relpath.replace(os.sep, '/')], 'rb').read()
        source = source.replace(b'\r\n', b'\n').replace(b'\r', b'\n')
        return submodname, is_package, fullpath, source
def _get_source ( self , fullmodname ) : submodname , is_package , relpath , fileobj = self . _get_info ( fullmodname ) fullpath = '%s%s%s' % ( fileobj , os . sep , relpath ) if isinstance ( fileobj , zipfile . ZipFile ) : source = fileobj . read ( relpath . replace ( os . sep , '/' ) ) elif isinstance ( fileobj , tarfile . TarFile ) : source = fileobj . extractfile ( relpath . replace ( os . sep , '/' ) ) . read ( ) elif isinstance ( fileobj , dict ) : source = fileobj [ relpath . replace ( os . sep , '/' ) ] . read ( ) else : source = open ( fileobj [ relpath . replace ( os . sep , '/' ) ] , 'rb' ) . read ( ) source = source . replace ( b'\r\n' , b'\n' ) . replace ( b'\r' , b'\n' ) return submodname , is_package , fullpath , source
Internal helper for load_module().

        Args:
          fullmodname: The dot-separated full module name, e.g. 'django.core.mail'.

        Returns:
          A tuple (submodname, is_package, fullpath, source) where:
            submodname: The final component of the module name, e.g. 'mail'.
            is_package: A bool indicating whether this is a package.
            fullpath: The path to the module's source code including the
              zipfile's or tarfile's filename.
            source: The module's source code.

        Raises:
          ImportError if the module is not found in the archive.