added main loop stub

This commit is contained in:
Simone Robutti 2021-05-13 13:32:44 +02:00
parent ed2d016715
commit 0e236a4be3
2 changed files with 16 additions and 2 deletions

14
mobilizon_bots/main.py Normal file
View File

@ -0,0 +1,14 @@
from mobilizon_bots.storage.db import MobilizonBotsDB
def main():
"""
STUB
:return:
"""
db = MobilizonBotsDB().setup()
unpublished_events = Mobilizon().get_unpublished_events()
published_events = db.get_published_events()
event = select_event_to_publish()
result = PublisherCoordinator(event).publish() if event else exit(0)
exit(0 if result.is_success() else 1)

View File

@ -3,8 +3,8 @@ from pathlib import Path
from tortoise import Tortoise
class MobotsDB:
def __init__(self, path: Path):
class MobilizonBotsDB:
def __init__(self, path: Path = None):
self.path = path
async def setup(self):