mirror of https://gitlab.com/litecord/litecord.git
run.py: fix typing in api_index()
This commit is contained in:
parent
fd1099607b
commit
c9c92890b4
13
run.py
13
run.py
|
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
import asyncio
|
||||
import sys
|
||||
from multiprocessing.managers import BaseManager
|
||||
from typing import Dict, Tuple, List
|
||||
|
||||
import asyncpg
|
||||
import logbook
|
||||
|
|
@ -290,8 +291,8 @@ def init_app_managers(app_: Quart, *, init_voice=True):
|
|||
|
||||
|
||||
async def api_index(app_):
|
||||
to_find = {}
|
||||
found = []
|
||||
to_find: Dict[Tuple[str, str], str] = {}
|
||||
found: List[str] = []
|
||||
|
||||
with open("discord_endpoints.txt") as fd:
|
||||
for line in fd.readlines():
|
||||
|
|
@ -325,17 +326,17 @@ async def api_index(app_):
|
|||
if pathname:
|
||||
found.append(pathname)
|
||||
|
||||
found = set(found)
|
||||
found_set = set(found)
|
||||
api = set(to_find.values())
|
||||
|
||||
missing = api - found
|
||||
missing = api - found_set
|
||||
|
||||
percentage = (len(found) / len(api)) * 100
|
||||
percentage = (len(found_set) / len(api)) * 100
|
||||
percentage = round(percentage, 2)
|
||||
|
||||
log.debug(
|
||||
"API compliance: {} out of {} ({} missing), {}% compliant",
|
||||
len(found),
|
||||
len(found_set),
|
||||
len(api),
|
||||
len(missing),
|
||||
percentage,
|
||||
|
|
|
|||
Loading…
Reference in New Issue