chore: refurish python code by applying Pylint linter rules (#8322)

This commit is contained in:
Bowen Liang
2024-09-13 22:42:08 +08:00
committed by GitHub
parent 1ab81b4972
commit a1104ab97e
126 changed files with 253 additions and 272 deletions

View File

@@ -158,7 +158,7 @@ class NotionOAuth(OAuthDataSource):
page_icon = page_result["icon"]
if page_icon:
icon_type = page_icon["type"]
if icon_type == "external" or icon_type == "file":
if icon_type in {"external", "file"}:
url = page_icon[icon_type]["url"]
icon = {"type": "url", "url": url if url.startswith("http") else f"https://www.notion.so{url}"}
else:
@@ -191,7 +191,7 @@ class NotionOAuth(OAuthDataSource):
page_icon = database_result["icon"]
if page_icon:
icon_type = page_icon["type"]
if icon_type == "external" or icon_type == "file":
if icon_type in {"external", "file"}:
url = page_icon[icon_type]["url"]
icon = {"type": "url", "url": url if url.startswith("http") else f"https://www.notion.so{url}"}
else:

View File

@@ -4,9 +4,9 @@ from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
import libs.gmpy2_pkcs10aep_cipher as gmpy2_pkcs10aep_cipher
from extensions.ext_redis import redis_client
from extensions.ext_storage import storage
from libs import gmpy2_pkcs10aep_cipher
def generate_key_pair(tenant_id):