From 7e2eb932c9b47dc99bb56a9555b854b92b2a8a25 Mon Sep 17 00:00:00 2001 From: yupix Date: Sat, 3 Feb 2024 01:14:22 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=83=97=E3=83=AD=E3=82=B0=E3=83=AC?= =?UTF-8?q?=E3=82=B9=E3=83=90=E3=83=BC=E3=82=92=E5=87=BA=E3=81=99=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/update_api_status.py | 10 ++++++---- requirements-dev.txt | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 requirements-dev.txt diff --git a/compiler/update_api_status.py b/compiler/update_api_status.py index ca2831b..134bb5b 100644 --- a/compiler/update_api_status.py +++ b/compiler/update_api_status.py @@ -5,6 +5,8 @@ import sys from type import OpenAPI from typing import Any, Literal, TypedDict +import tqdm + sys.path.append("../") from mipac.utils.util import COLORS # noqa: E402 @@ -51,7 +53,7 @@ with open('./datas/endpoints.json', mode='r', encoding='utf-8') as f: _endpoints: IData = copy.deepcopy(endpoints) # パスに関する情報を更新する -for path in api['paths']: +for path in tqdm.tqdm(api['paths']): old_data = endpoints["endpoints"]['support'].get(path, None) current_request_body_hash = get_sha256_hash(api['paths'][path]['post'].get('requestBody', {})) current_response_body_hash = get_sha256_hash(api['paths'][path]['post'].get('responses', {})) @@ -82,20 +84,20 @@ for path in api['paths']: # Misskeyから削除されたエンドポイントをremovedに移動する -for path in _endpoints["endpoints"]['support']: +for path in tqdm.tqdm(_endpoints["endpoints"]['support']): endpoints["endpoints"]['removed'][path] = _endpoints["endpoints"]['support'][path] # Misskeyから削除された場合はRemovedFromMisskeyにする endpoints["endpoints"]['removed'][path]['status'] = "RemovedFromMisskey" del endpoints["endpoints"]['support'][path] # MiPACからの削除が完了した場合はremovedから削除する -for path in _endpoints["endpoints"]['removed']: +for path in tqdm.tqdm(_endpoints["endpoints"]['removed']): if endpoints["endpoints"]['removed'][path]['status'] == "Removed": del endpoints["endpoints"]['removed'][path] continue # スキーマに関する情報を更新する -for schema in api['components']['schemas']: +for schema in tqdm.tqdm(api['components']['schemas']): try: del _endpoints["schemas"][schema] except KeyError: diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..78620c4 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +tqdm