rename to frontend.py & backend.py
This commit is contained in:
parent
bd2599c91a
commit
c612a9dee0
6
db.py
6
db.py
|
@ -5,14 +5,14 @@ import jwt
|
|||
from os import path, urandom
|
||||
from pylibscrypt import scrypt_mcf, scrypt_mcf_check
|
||||
import sqlite3
|
||||
import ticketfrei
|
||||
import backend
|
||||
from mastodon import Mastodon
|
||||
|
||||
|
||||
class DB(object):
|
||||
def __init__(self):
|
||||
self.config = ticketfrei.get_config()
|
||||
self.logger = ticketfrei.get_logger(self.config)
|
||||
self.config = backend.get_config()
|
||||
self.logger = backend.get_logger(self.config)
|
||||
dbfile = path.join(path.dirname(path.abspath(__file__)),
|
||||
'ticketfrei.sqlite')
|
||||
self.conn = sqlite3.connect(dbfile)
|
||||
|
|
|
@ -5,7 +5,7 @@ import base64
|
|||
import bottle
|
||||
import sqlite3
|
||||
import sendmail
|
||||
import ticketfrei
|
||||
import backend
|
||||
import jwt
|
||||
import pylibscrypt
|
||||
import smtplib
|
||||
|
@ -345,7 +345,7 @@ class StripPathMiddleware(object):
|
|||
|
||||
if __name__ == "__main__":
|
||||
global config
|
||||
config = ticketfrei.get_config()
|
||||
config = backend.get_config()
|
||||
|
||||
global db
|
||||
global secret
|
||||
|
|
|
@ -6,7 +6,7 @@ import time
|
|||
import trigger
|
||||
import datetime
|
||||
import email
|
||||
import ticketfrei
|
||||
import backend
|
||||
import imaplib
|
||||
import report
|
||||
|
||||
|
@ -25,7 +25,7 @@ class Mailbot(object):
|
|||
:param config: (dictionary) config.toml as a dictionary of dictionaries
|
||||
"""
|
||||
self.config = config
|
||||
self.logger = ticketfrei.get_logger(config)
|
||||
self.logger = backend.get_logger(config)
|
||||
|
||||
self.history_path = history_path
|
||||
self.last_mail = self.get_history(self.history_path)
|
||||
|
@ -56,7 +56,7 @@ class Mailbot(object):
|
|||
def repost(self, status):
|
||||
"""
|
||||
E-Mails don't have to be reposted - they already reached everyone on the mailing list.
|
||||
The function still needs to be here because ticketfrei.py assumes it, and take the
|
||||
The function still needs to be here because backend.py assumes it, and take the
|
||||
report object they want to give us.
|
||||
|
||||
:param status: (report.Report object)
|
||||
|
@ -171,7 +171,7 @@ class Mailbot(object):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
config = ticketfrei.get_config()
|
||||
config = backend.get_config()
|
||||
|
||||
# initialise trigger
|
||||
trigger = trigger.Trigger(config)
|
||||
|
|
|
@ -8,12 +8,12 @@ import time
|
|||
import trigger
|
||||
import sendmail
|
||||
import report
|
||||
import ticketfrei
|
||||
import backend
|
||||
|
||||
class RetootBot(object):
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
self.logger = ticketfrei.get_logger(config)
|
||||
self.logger = backend.get_logger(config)
|
||||
self.client_id = self.register()
|
||||
self.m = self.login()
|
||||
|
||||
|
@ -126,7 +126,7 @@ class RetootBot(object):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
config = ticketfrei.get_config()
|
||||
config = backend.get_config()
|
||||
|
||||
trigger = trigger.Trigger(config)
|
||||
bot = RetootBot(config)
|
||||
|
|
|
@ -6,7 +6,7 @@ import requests
|
|||
import trigger
|
||||
from time import sleep
|
||||
import report
|
||||
import ticketfrei
|
||||
import backend
|
||||
import sendmail
|
||||
|
||||
class RetweetBot(object):
|
||||
|
@ -29,7 +29,7 @@ class RetweetBot(object):
|
|||
Tweet
|
||||
"""
|
||||
self.config = config
|
||||
self.logger = ticketfrei.get_logger(config)
|
||||
self.logger = backend.get_logger(config)
|
||||
|
||||
# initialize API access
|
||||
keys = self.get_api_keys()
|
||||
|
@ -200,7 +200,7 @@ class RetweetBot(object):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
config = ticketfrei.get_config()
|
||||
config = backend.get_config()
|
||||
|
||||
# initialise trigger
|
||||
trigger = trigger.Trigger(config)
|
||||
|
|
|
@ -66,8 +66,8 @@ class Mailer(object):
|
|||
|
||||
# For testing:
|
||||
if __name__ == '__main__':
|
||||
import ticketfrei
|
||||
config = ticketfrei.get_config()
|
||||
import backend
|
||||
config = backend.get_config()
|
||||
|
||||
m = Mailer(config)
|
||||
print(m.send("This is a test mail.", m.fromaddr, "Test"))
|
||||
|
|
|
@ -57,8 +57,8 @@ class Trigger(object):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ticketfrei
|
||||
config = ticketfrei.get_config()
|
||||
import backend
|
||||
config = backend.get_config()
|
||||
|
||||
print("testing the trigger")
|
||||
trigger = Trigger(config)
|
||||
|
|
Loading…
Reference in a new issue