First fix, SQL log errata deny all updates

This commit is contained in:
2019-03-13 11:37:14 +01:00
parent e88675331c
commit c4f1510e25
2 changed files with 8 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ First: Name, a line like below, with the name
Then, the revision number, when this number changes, cook will be reapplied Then, the revision number, when this number changes, cook will be reapplied
"revision: 1" "revision: 1"
If the cook has to run everytime client is called (And not only one time per new revision), you have to add: If the cook has to run everytime client is called (And not only one time per new revision), you have to add:
"runever: 1" (1-> Everytime; 0 or no line: Run only one time) "runever: 1" (1-> Everytime, if you change to 0 or delete, it will not do it)
And then, steps. First a "steps:" line, and then line by line the steps of the cook And then, steps. First a "steps:" line, and then line by line the steps of the cook
"steps: "steps:
- PWCMD|White-Output "Hello World" - PWCMD|White-Output "Hello World"

9
sql.py
View File

@@ -1,3 +1,4 @@
# Build 2
import sqlite3 import sqlite3
import sysopt #File of options import sysopt #File of options
from shutil import copyfile from shutil import copyfile
@@ -34,12 +35,16 @@ def select(query):
def insert(query): def insert(query):
conn = sqlite3.connect('BD/database.db') conn = sqlite3.connect('BD/database.db')
if sysopt.debugsql==True: if sysopt.debugsql==True:
logit(query) logit("SQL: "+query)
try: try:
c = conn.cursor() c = conn.cursor()
c.execute("SQL: "+query) c.execute(query)
conn.commit() conn.commit()
conn.close() conn.close()
if sysopt.debugsql==True:
logit("SQL Ok")
return {'RESULT': 'OK'} return {'RESULT': 'OK'}
except: except:
if sysopt.debugsql==True:
logit("SQL Error")
return {'RESULT': 'SQLite3 Error'} return {'RESULT': 'SQLite3 Error'}