def plugin_install(app, fobj, request, filename):
 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

def plugin_install ( app , fobj , request , filename ) : 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
installs a plugin: - identifies file type by filename - writes fobj contents to the .