Compare commits
No commits in common. "41767c044ef6d07d393d5a7b4f24913a02ee919c" and "595d29ef0104c3cd05011fa672c7e8dcf71420f0" have entirely different histories.
41767c044e
...
595d29ef01
5
main.py
5
main.py
@ -10,7 +10,6 @@ from gpxpy import gpx
|
|||||||
from sqlalchemy import create_engine, text
|
from sqlalchemy import create_engine, text
|
||||||
from sqlalchemy.engine import Connection
|
from sqlalchemy.engine import Connection
|
||||||
import gpxpy
|
import gpxpy
|
||||||
from bs4 import BeautifulSoup
|
|
||||||
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
@ -19,7 +18,7 @@ config.read('config.ini')
|
|||||||
db = create_engine(f"postgresql://{config['db']['username']}:{config['db']['password']}@{config['db']['host']}/{config['db']['database']}").connect()
|
db = create_engine(f"postgresql://{config['db']['username']}:{config['db']['password']}@{config['db']['host']}/{config['db']['database']}").connect()
|
||||||
|
|
||||||
mail = IMAP4(host=config['mail']['host'])
|
mail = IMAP4(host=config['mail']['host'])
|
||||||
fitotrack_msg_filter = 'ALL'
|
fitotrack_msg_filter = '(OR SUBJECT "fitotrack" SUBJECT "Fitotrack" SUBJECT "FITOTRACK" SUBJECT "FitoTrack")'
|
||||||
|
|
||||||
|
|
||||||
def init_database():
|
def init_database():
|
||||||
@ -50,9 +49,7 @@ def get_gpx_files_from_mail():
|
|||||||
if filename and not os.path.exists(f'gpx_files/{filename}'):
|
if filename and not os.path.exists(f'gpx_files/{filename}'):
|
||||||
with open(os.path.join('gpx_files', filename), 'wb') as f:
|
with open(os.path.join('gpx_files', filename), 'wb') as f:
|
||||||
f.write(part.get_payload(decode=True))
|
f.write(part.get_payload(decode=True))
|
||||||
mail.store(i, '+FLAGS', '\\Deleted')
|
|
||||||
|
|
||||||
mail.expunge()
|
|
||||||
mail.logout()
|
mail.logout()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user