-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
29 lines (23 loc) · 711 Bytes
/
run.py
File metadata and controls
29 lines (23 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
from app.db import create_connection
from app.data import load_data
from app import sheet
import os
def main():
db_file = ':memory:'
# db_file = 'my.db'
sheet_name = "LineageOS Phones Automated"
fono_file = os.path.join('data', 'fono_fields.csv')
FONO_API = os.environ['FONO_API']
try:
debug = bool(os.environ['DEBUG'])
except:
debug = False
# db connection and load data
if not os.path.exists(fono_file):
db_conn = create_connection(db_file)
load_data(db_conn, fono_file)
gsheet_conn = sheet.connect()
sheet.write_data(gsheet_conn, sheet_name, fono_file, debug=debug)
if __name__ == "__main__":
main()