Compare commits
No commits in common. "6a19ae637b8b79a21e5ed4a30861b3b6d31070f1" and "2f8085109f598026b00e2940411afb2614306eec" have entirely different histories.
6a19ae637b
...
2f8085109f
12
init.sql
12
init.sql
@ -1,12 +0,0 @@
|
|||||||
create table if not exists training(
|
|
||||||
id integer primary key,
|
|
||||||
medium varchar(255) not null,
|
|
||||||
uuid uuid not null,
|
|
||||||
t timestamp with time zone not null,
|
|
||||||
lat float not null,
|
|
||||||
lon float not null,
|
|
||||||
speed float not null,
|
|
||||||
altitude float not null,
|
|
||||||
distance float not null,
|
|
||||||
kcal int not null
|
|
||||||
);
|
|
15
main.py
15
main.py
@ -5,20 +5,7 @@ from sqlalchemy import create_engine
|
|||||||
|
|
||||||
|
|
||||||
config = configparser.ConfigParser().read('config.ini')
|
config = configparser.ConfigParser().read('config.ini')
|
||||||
db = create_engine(f"postgresql://{config['db'][1]}:{config['db'][2]}@{config['db'][0]}/{config['db'][3]}").connect()
|
db = create_engine(f"postgresql://{config['db']['username']}:{config['db']['password']}@{config['db']['host']}/{config['db']['database']}")
|
||||||
mail = IMAP4(host=config['mail'][0])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def init_database():
|
|
||||||
with open('init.sql') as f:
|
|
||||||
db.execute('\n'.join(f.readlines()))
|
|
||||||
|
|
||||||
|
|
||||||
def get_gpx_files_from_mail():
|
|
||||||
mail.login(config['mail'][1], config['mail'][2])
|
|
||||||
|
|
||||||
mail.logout()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user