2026-10-05 00:32:54 +02:00
|
|
|
"""The platform registry: name -> driver class and its site."""
|
|
|
|
|
from dialects.akkoma import Akkoma
|
|
|
|
|
from dialects.gts import Gts
|
|
|
|
|
from dialects.hollo import Hollo
|
2026-10-05 01:54:36 +02:00
|
|
|
from dialects.iceshrimp import Iceshrimp
|
2026-10-05 00:32:54 +02:00
|
|
|
from dialects.lemmy_api import LemmyApi
|
|
|
|
|
from dialects.mastodon import Mastodon
|
|
|
|
|
from dialects.misskey_api import Misskey, Sharkey
|
2026-10-05 02:53:58 +02:00
|
|
|
from dialects.pleroma import Pleroma
|
2026-10-05 00:32:54 +02:00
|
|
|
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"),
|
2026-10-05 01:54:36 +02:00
|
|
|
"iceshrimp": (Iceshrimp, "iceshrimp.test"),
|
2026-10-05 02:53:58 +02:00
|
|
|
"pleroma": (Pleroma, "pleroma.test"),
|
2026-10-05 00:32:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_made = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def driver(platform):
|
|
|
|
|
if platform not in _made:
|
|
|
|
|
cls, host = DRIVERS[platform]
|
|
|
|
|
_made[platform] = cls(host)
|
|
|
|
|
return _made[platform]
|