Create database
- Create database - Add table to store log entries - Insert borg output to database
This commit is contained in:
parent
88319cba3c
commit
75beecf584
14
main.py
14
main.py
|
@ -1,5 +1,6 @@
|
||||||
from sys import stdin
|
from sys import stdin
|
||||||
from LogEntry import *
|
from LogEntry import *
|
||||||
|
from Database import *
|
||||||
|
|
||||||
raw_borg_output = stdin.readlines()
|
raw_borg_output = stdin.readlines()
|
||||||
|
|
||||||
|
@ -24,3 +25,16 @@ borg_output = LogEntry(attributes["Archive name: "],
|
||||||
attributes["Number of files: "])
|
attributes["Number of files: "])
|
||||||
|
|
||||||
borg_output.print_to_file("borg.txt")
|
borg_output.print_to_file("borg.txt")
|
||||||
|
|
||||||
|
database = Database("borg.db")
|
||||||
|
|
||||||
|
row_list = ["ID INTEGER PRIMARY KEY",
|
||||||
|
"NAME TEXT NOT NULL",
|
||||||
|
"FINGERPRINT TEXT NOT NULL",
|
||||||
|
"START_TIME DATETIME NOT NULL",
|
||||||
|
"DURATION REAL NOT NULL",
|
||||||
|
"FILE_COUNT INTEGER NOT NULL"]
|
||||||
|
|
||||||
|
database.create_table("log_entries", row_list)
|
||||||
|
|
||||||
|
database.insert(borg_output, "log_entries")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user