chore: update ft_client to modern typing syntax

This commit is contained in:
Matthias
2024-10-04 07:08:56 +02:00
parent 8ec5dd6def
commit 628983d123
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import logging
import re import re
import sys import sys
from pathlib import Path from pathlib import Path
from typing import Any, Dict from typing import Any
import rapidjson import rapidjson
@@ -81,7 +81,7 @@ def print_commands():
print(f"{x}\n\t{doc}\n") print(f"{x}\n\t{doc}\n")
def main_exec(parsed: Dict[str, Any]): def main_exec(parsed: dict[str, Any]):
if parsed.get("show"): if parsed.get("show"):
print_commands() print_commands()
sys.exit() sys.exit()
+3 -3
View File
@@ -7,7 +7,7 @@ so it can be used as a standalone script, and can be installed independently.
import json import json
import logging import logging
from typing import Any, Dict, List, Optional, Union from typing import Any, Optional, Union
from urllib.parse import urlencode, urlparse, urlunparse from urllib.parse import urlencode, urlparse, urlunparse
import requests import requests
@@ -16,8 +16,8 @@ from requests.exceptions import ConnectionError
logger = logging.getLogger("ft_rest_client") logger = logging.getLogger("ft_rest_client")
ParamsT = Optional[Dict[str, Any]] ParamsT = Optional[dict[str, Any]]
PostDataT = Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] PostDataT = Optional[Union[dict[str, Any], list[dict[str, Any]]]]
class FtRestClient: class FtRestClient: