mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2026-02-04 10:14:15 +02:00
replaced all flask references with quart references
This commit is contained in:
24
docs/api.rst
24
docs/api.rst
@@ -8,11 +8,11 @@ attributes and available methods.
|
||||
Discord OAuth2 Client
|
||||
---------------------
|
||||
|
||||
.. autoclass:: flask_discord.DiscordOAuth2Session
|
||||
.. autoclass:: quart_discord.DiscordOAuth2Session
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
.. autoclass:: flask_discord._http.DiscordOAuth2HttpClient
|
||||
.. autoclass:: quart_discord._http.DiscordOAuth2HttpClient
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
@@ -20,23 +20,23 @@ Discord OAuth2 Client
|
||||
Models
|
||||
------
|
||||
|
||||
.. autoclass:: flask_discord.models.Guild
|
||||
.. autoclass:: quart_discord.models.Guild
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
.. autoclass:: flask_discord.models.User
|
||||
.. autoclass:: quart_discord.models.User
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
.. autoclass:: flask_discord.models.Bot
|
||||
.. autoclass:: quart_discord.models.Bot
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
.. autoclass:: flask_discord.models.Integration
|
||||
.. autoclass:: quart_discord.models.Integration
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
.. autoclass:: flask_discord.models.UserConnection
|
||||
.. autoclass:: quart_discord.models.UserConnection
|
||||
:members:
|
||||
:inherited-members:
|
||||
|
||||
@@ -44,20 +44,20 @@ Models
|
||||
Utilities
|
||||
---------
|
||||
|
||||
.. autodecorator:: flask_discord.requires_authorization
|
||||
.. autodecorator:: quart_discord.requires_authorization
|
||||
|
||||
|
||||
Exceptions
|
||||
----------
|
||||
|
||||
.. autoclass:: flask_discord.HttpException
|
||||
.. autoclass:: quart_discord.HttpException
|
||||
:members:
|
||||
|
||||
.. autoclass:: flask_discord.RateLimited
|
||||
.. autoclass:: quart_discord.RateLimited
|
||||
:members:
|
||||
|
||||
.. autoclass:: flask_discord.Unauthorized
|
||||
.. autoclass:: quart_discord.Unauthorized
|
||||
:members:
|
||||
|
||||
.. autoclass:: flask_discord.AccessDenied
|
||||
.. autoclass:: quart_discord.AccessDenied
|
||||
:members:
|
||||
|
||||
12
docs/conf.py
12
docs/conf.py
@@ -14,16 +14,16 @@ import os
|
||||
import re
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
sys.path.append('../flask_discord/')
|
||||
sys.path.append('../quart_discord/')
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'Flask-Discord'
|
||||
copyright = '2019, □ | The Cosmos'
|
||||
author = '□ | The Cosmos'
|
||||
project = 'Quart-Discord'
|
||||
copyright = '2020, Philip Dowie'
|
||||
author = 'Philip Dowie'
|
||||
|
||||
with open('../flask_discord/__init__.py') as f:
|
||||
with open('../quart_discord/__init__.py') as f:
|
||||
ver = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
|
||||
# The short X.Y version
|
||||
version = ver
|
||||
@@ -48,7 +48,7 @@ extensions = [
|
||||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3', None),
|
||||
'discord': ('https://discordpy.readthedocs.io/en/latest/', None),
|
||||
'flask': ('https://flask.palletsprojects.com/en/1.1.x/', None),
|
||||
'quart': ('https://pgjones.gitlab.io/quart/', None),
|
||||
'cachetools': ('https://cachetools.readthedocs.io/en/stable/', None),
|
||||
'requests_oauthlib': ('https://requests-oauthlib.readthedocs.io/en/latest/', None)
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
.. Flask-Discord documentation master file, created by
|
||||
.. Quart-Discord documentation master file, created by
|
||||
sphinx-quickstart on Wed May 8 08:29:45 2019.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Flask-Discord's documentation!
|
||||
Welcome to Quart-Discord's documentation!
|
||||
=========================================
|
||||
|
||||
.. image:: /images/background.jpg
|
||||
|
||||
Flask-Discord is an extension made for Flask which makes implementation of
|
||||
Quart-Discord is an extension made for Quart which makes implementation of
|
||||
Discord's OAuth2 API easier.
|
||||
|
||||
**Features**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
Flask-Discord is an extension for Flask - Python web framework which
|
||||
Quart-Discord is an extension for Quart - Python web framework which
|
||||
makes easy implementation of Discord OAuth2 API. After creating a discord
|
||||
client object, one can easily request authorization and hence any of the
|
||||
resources provided by the discord OAuth2 API under the available scope
|
||||
@@ -14,14 +14,14 @@ permissions.
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- **Flask**
|
||||
This is an Flask extension.
|
||||
- **Quart**
|
||||
This is a Quart extension.
|
||||
|
||||
- **requests_oauthlib**
|
||||
It also requires requests_oauthlib to make OAuth2 sessions with discord.
|
||||
|
||||
- **cachetools**
|
||||
Flask Discord supports caching discord objects to boost the performance when page loads.
|
||||
Quart Discord supports caching discord objects to boost the performance when page loads.
|
||||
|
||||
- **discord.py**
|
||||
Makes use of discord.py for re-using many Discord models.
|
||||
@@ -29,15 +29,15 @@ Requirements
|
||||
Installing
|
||||
----------
|
||||
|
||||
You can install Flask-Discord directly from PyPI using PIP and following command
|
||||
You can install Quart-Discord directly from PyPI using PIP and following command
|
||||
in shell or command prompt: ::
|
||||
|
||||
python3 -m pip install -U Flask-Discord
|
||||
python3 -m pip install -U Quart-Discord
|
||||
|
||||
You can also install the latest development version (**maybe unstable/broken**) by
|
||||
using following command: ::
|
||||
|
||||
python3 -m pip install -U git+https://github.com/thec0sm0s/Flask-Discord.git@dev
|
||||
python3 -m pip install -U git+https://github.com/jnawk/Quart-Discord.git@dev
|
||||
|
||||
|
||||
Basic Usage
|
||||
@@ -48,12 +48,12 @@ in exchange for fetching user's details and display them on web page.
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
from flask import Flask, redirect, url_for
|
||||
from flask_discord import DiscordOAuth2Session, requires_authorization, Unauthorized
|
||||
from quart import Quart, redirect, url_for
|
||||
from quart_discord import DiscordOAuth2Session, requires_authorization, Unauthorized
|
||||
|
||||
app = Flask(__name__)
|
||||
app = Quart(__name__)
|
||||
|
||||
app.secret_key = b"random bytes representing flask secret key"
|
||||
app.secret_key = b"random bytes representing quart secret key"
|
||||
|
||||
app.config["DISCORD_CLIENT_ID"] = 490732332240863233 # Discord client ID.
|
||||
app.config["DISCORD_CLIENT_SECRET"] = "" # Discord client secret.
|
||||
|
||||
Reference in New Issue
Block a user