Compare commits
3 Commits
e81c81c190
...
184e13b698
Author | SHA1 | Date | |
---|---|---|---|
184e13b698 | |||
b1012d2ce3 | |||
ce7b59fe6e |
15
main.py
15
main.py
@ -1,13 +1,16 @@
|
||||
import configparser
|
||||
from imaplib import IMAP4
|
||||
import ssl
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
|
||||
config = configparser.ConfigParser().read('config.ini')
|
||||
db = create_engine(f"postgresql://{config['db'][1]}:{config['db'][2]}@{config['db'][0]}/{config['db'][3]}").connect()
|
||||
mail = IMAP4(host=config['mail'][0])
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
|
||||
db = create_engine(f"postgresql://{config['db']['username']}:{config['db']['password']}@{config['db']['host']}/{config['db']['database']}").connect()
|
||||
|
||||
mail = IMAP4(host=config['mail']['host'])
|
||||
|
||||
|
||||
def init_database():
|
||||
@ -16,13 +19,15 @@ def init_database():
|
||||
|
||||
|
||||
def get_gpx_files_from_mail():
|
||||
mail.login(config['mail'][1], config['mail'][2])
|
||||
mail.starttls(ssl.create_default_context())
|
||||
mail.login(config['mail']['username'], config['mail']['password'])
|
||||
|
||||
mail.logout()
|
||||
|
||||
|
||||
def main():
|
||||
pass
|
||||
init_database()
|
||||
get_gpx_files_from_mail()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user