first implementation of protobuf

restructure in client server model
loads of work still missing
This commit is contained in:
2017-01-31 15:00:44 +01:00
parent 7d6d289178
commit d79dde527f
29 changed files with 1611 additions and 400 deletions

22
ledd/db_helper.py Normal file
View File

@@ -0,0 +1,22 @@
DB_VERSION = 1
def check_db(conn):
cur = conn.cursor()
cur.execute("SELECT value FROM meta WHERE name='version'")
ver = cur.fetchone()
if ver:
ver = int(ver)
if ver < DB_VERSION:
upgrade_db(conn, ver, DB_VERSION)
else:
with open('sql/ledd.sql', 'r') as f:
cur.executescript(f.read())
conn.commit()
def upgrade_db(conn, old, new):
pass