def plugin_install(app, fobj, request, filename):
    """Installs a plugin:

    - Identifies file type by filename
    - Writes `fobj` contents to the `../deposit/` folder
    - Calls `w2p_unpack_plugin()` to do the job.

    Args:
        app(str): new application name
        fobj: file object containing the application to be installed
        request: the global request object
        filename: original filename of the `fobj`,
            required to determine extension

    Returns:
        name of the file where plugin is temporarily stored
        or `False` on failure

    """
    upname = apath('../deposit/%s' % filename, request)

    try:
        write_file(upname, fobj.read(), 'wb')
        path = apath(app, request)
        w2p_unpack_plugin(upname, path)
        fix_newlines(path)
        return upname
    except Exception:
        os.unlink(upname)
        return False
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/admin.py/plugin_install/original