mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-02-14 10:40:57 +01:00
* decoupled notifiers from event * stub * publishers working * fixed format CLI * fixed unit tests * renamed abstractnotifier * added another excluded character
36 lines
776 B
Python
36 lines
776 B
Python
from mobilizon_reshare.publishers.platforms.telegram import (
|
|
TelegramPublisher,
|
|
TelegramFormatter,
|
|
TelegramNotifier,
|
|
)
|
|
from mobilizon_reshare.publishers.platforms.zulip import (
|
|
ZulipPublisher,
|
|
ZulipFormatter,
|
|
ZulipNotifier,
|
|
)
|
|
|
|
name_to_publisher_class = {
|
|
"telegram": TelegramPublisher,
|
|
"zulip": ZulipPublisher,
|
|
}
|
|
name_to_formatter_class = {
|
|
"telegram": TelegramFormatter,
|
|
"zulip": ZulipFormatter,
|
|
}
|
|
name_to_notifier_class = {
|
|
"telegram": TelegramNotifier,
|
|
"zulip": ZulipNotifier,
|
|
}
|
|
|
|
|
|
def get_notifier_class(platform):
|
|
return name_to_notifier_class[platform]
|
|
|
|
|
|
def get_publisher_class(platform):
|
|
return name_to_publisher_class[platform]
|
|
|
|
|
|
def get_formatter_class(platform):
|
|
return name_to_formatter_class[platform]
|