type compatibility for Python < 3.11
This commit is contained in:
@@ -53,7 +53,7 @@ import sys
|
|||||||
import urllib.parse as urlparse
|
import urllib.parse as urlparse
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from operator import add
|
from operator import add
|
||||||
from typing import Any, TextIO, TypedDict, Union
|
from typing import Any, TextIO, TypedDict, Union, List
|
||||||
|
|
||||||
from qrcode import QRCode # type: ignore
|
from qrcode import QRCode # type: ignore
|
||||||
|
|
||||||
@@ -81,9 +81,12 @@ except ImportError:
|
|||||||
# Types
|
# Types
|
||||||
Args = argparse.Namespace
|
Args = argparse.Namespace
|
||||||
OtpUrl = str
|
OtpUrl = str
|
||||||
|
# PYTHON 3.11: Otp = TypedDict('Otp', {'name': str, 'secret': str, 'issuer': str, 'type': str, 'counter': int | None, 'url': OtpUrl})
|
||||||
Otp = TypedDict('Otp', {'name': str, 'secret': str, 'issuer': str, 'type': str, 'counter': Union[int, None], 'url': OtpUrl})
|
Otp = TypedDict('Otp', {'name': str, 'secret': str, 'issuer': str, 'type': str, 'counter': Union[int, None], 'url': OtpUrl})
|
||||||
Otps = list[Otp]
|
# PYTHON 3.11: Otps = list[Otp]
|
||||||
OtpUrls = list[OtpUrl]
|
Otps = List[Otp]
|
||||||
|
# PYTHON 3.11: OtpUrls = list[OtpUrl]
|
||||||
|
OtpUrls = List[OtpUrl]
|
||||||
|
|
||||||
|
|
||||||
# Global variable declaration
|
# Global variable declaration
|
||||||
|
|||||||
Reference in New Issue
Block a user