Files
SocialPub/tools/pasture/town/dialects/__init__.py
T

34 lines
1.0 KiB
Python
Raw Normal View History

"""The platform registry: name -> driver class and its site."""
from dialects.akkoma import Akkoma
from dialects.gts import Gts
from dialects.hollo import Hollo
from dialects.iceshrimp import Iceshrimp
from dialects.lemmy_api import LemmyApi
from dialects.mastodon import Mastodon
from dialects.misskey_api import Misskey, Sharkey
2026-10-05 07:01:38 +02:00
from dialects.pixelfed import Pixelfed
from dialects.pleroma import Pleroma
from dialects.privapub import PrivaPub
DRIVERS = {
"privapub": (PrivaPub, "privapub.test"),
"gts": (Gts, "gts.test"),
"mastodon": (Mastodon, "mastodon.test"),
"misskey": (Misskey, "misskey.test"),
"sharkey": (Sharkey, "sharkey.test"),
"akkoma": (Akkoma, "akkoma.test"),
"lemmy": (LemmyApi, "lemmy.test"),
"hollo": (Hollo, "hollo.test"),
"iceshrimp": (Iceshrimp, "iceshrimp.test"),
"pleroma": (Pleroma, "pleroma.test"),
2026-10-05 07:01:38 +02:00
"pixelfed": (Pixelfed, "pixelfed.test"),
}
_made = {}
def driver(platform):
if platform not in _made:
cls, host = DRIVERS[platform]
_made[platform] = cls(host)
return _made[platform]