1
0

Ruff checks
All checks were successful
Python Package / Package (push) Successful in 20s

This commit is contained in:
Jon Michael Aanes 2024-05-12 16:38:15 +02:00
parent cc4b666011
commit 6e6e5e63be
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
2 changed files with 4 additions and 4 deletions

View File

@ -1,15 +1,13 @@
"""Small utility for detecting social websites."""
import datetime
import re
import urllib.parse
from dataclasses import dataclass
from typing import List, Optional, Set, Union
import aenum
from enforce_typing import enforce_types
from socials_util._version import __version__
from socials_util._version import __version__ # noqa: F401
class SocialSiteId(aenum.Enum):
@ -408,7 +406,9 @@ WELL_KNOWN_MASTODON_INSTANCES: frozenset[str] = frozenset(
def determine_social_from_url_internally(
url: str,
) -> tuple[SocialSiteId | None, str | None]:
assert isinstance(url, str)
if not isinstance(url, str):
msg = f'Url must be {str}'
raise TypeError(msg)
# Regexes
for social_site_url_regex, social_site_id in REGEXES:

0
test/__init__.py Normal file
View File