mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-02-15 19:20:52 +01:00
29 lines
717 B
Python
29 lines
717 B
Python
import logging.config
|
|
from pathlib import Path
|
|
|
|
from tortoise import run_async
|
|
|
|
from mobilizon_bots.config.config import settings
|
|
from mobilizon_bots.storage.db import MobilizonBotsDB
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
async def main():
|
|
"""
|
|
STUB
|
|
:return:
|
|
"""
|
|
logging.config.dictConfig(settings.logging)
|
|
db = MobilizonBotsDB(Path(settings.db_path))
|
|
await db.setup()
|
|
published_events = db.get_published_events()
|
|
unpublished_events = get_unpublished_events(published_events)
|
|
event = select_event_to_publish()
|
|
result = PublisherCoordinator(event).publish() if event else exit(0)
|
|
exit(0 if result.is_success() else 1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
run_async(main())
|