romeotools/worker.py

19 lines
No EOL
344 B
Python

import json
import datetime
import sqlite3
from classes.database import Database
from classes.api import RomeoAPI
try:
from settings import USERNAME, PASSWORD
except:
USERNAME, PASSWORD = None, None
api = RomeoAPI(True, USERNAME, PASSWORD)
db = Database()
db.create_tables()
for message in api.messages():
message.to_database()