Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
d75f003
1
Parent(s):
929bc3e
Update my_sqlite.py
Browse files- my_sqlite.py +1 -77
my_sqlite.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
import sqlite3
|
2 |
|
3 |
-
|
4 |
-
import globs
|
5 |
-
import os
|
6 |
-
api_variable = os.getenv('api_key_s')
|
7 |
|
8 |
def create_database_and_table():
|
9 |
# Создание подключения к базе данных SQLite
|
@@ -40,76 +37,3 @@ def create_database_and_table():
|
|
40 |
|
41 |
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
def sql_save():
|
47 |
-
err = 0
|
48 |
-
|
49 |
-
# Проверяем условие и выполняем кусок кода, если условие истинно
|
50 |
-
if api_variable == request.args.get('api'):
|
51 |
-
# Вставьте сюда ваш кусок кода, который должен выполняться, если условие истинно
|
52 |
-
# Читаем значение параметра и заносим в глобальную переменную
|
53 |
-
globs.dey = request.args.get('dey')
|
54 |
-
globs.wek = request.args.get('wek')
|
55 |
-
globs.v_hid = request.args.get('v_hid')
|
56 |
-
globs.v_min = request.args.get('v_min')
|
57 |
-
globs.ph = request.args.get('ph')
|
58 |
-
globs.ec = request.args.get('ec')
|
59 |
-
globs.tS = request.args.get('tS')
|
60 |
-
globs.tA = request.args.get('tA')
|
61 |
-
globs.hDm = request.args.get('hDm')
|
62 |
-
globs.sVen = request.args.get('sVen')
|
63 |
-
|
64 |
-
globs.rFul = request.args.get('rFul')
|
65 |
-
globs.rLi = request.args.get('rLi')
|
66 |
-
globs.rWat = request.args.get('rWat')
|
67 |
-
globs.rRas = request.args.get('rRas')
|
68 |
-
globs.rPH = request.args.get('rPH')
|
69 |
-
globs.rEC = request.args.get('rEC')
|
70 |
-
globs.rSl = request.args.get('rSl')
|
71 |
-
globs.rLe = request.args.get('rLe')
|
72 |
-
globs.alW = request.args.get('alW')
|
73 |
-
|
74 |
-
globs.ph_eep = request.args.get('ph_eep')
|
75 |
-
globs.ph_on_eep = request.args.get('ph_on_eep')
|
76 |
-
globs.ec_eep = request.args.get('ec_eep')
|
77 |
-
globs.ec_A_eep = request.args.get('ec_A_eep')
|
78 |
-
globs.ec_B_eep = request.args.get('ec_B_eep')
|
79 |
-
globs.ec_C_eep = request.args.get('ec_C_eep')
|
80 |
-
|
81 |
-
globs.l_ON_h_eep = request.args.get('l_ON_h_eep')
|
82 |
-
globs.l_ON_m_eep = request.args.get('l_ON_m_eep')
|
83 |
-
globs.l_OFF_h_eep = request.args.get('l_OFF_h_eep')
|
84 |
-
globs.l_OFF_m_eep = request.args.get('l_OFF_m_eep')
|
85 |
-
globs.t_Voz_eep = request.args.get('t_Voz_eep')
|
86 |
-
|
87 |
-
err = 1
|
88 |
-
pass
|
89 |
-
else:
|
90 |
-
# Вставьте сюда ваш кусок кода, который должен выполняться, если условие ложно
|
91 |
-
|
92 |
-
err = 0
|
93 |
-
pass
|
94 |
-
|
95 |
-
# Создаем JSON-объект
|
96 |
-
response = {
|
97 |
-
"1_ph_set": globs.ph_set,
|
98 |
-
"2_ph_on_set": globs.ph_on_set,
|
99 |
-
"3_ec_set": globs.ec_set,
|
100 |
-
"4_ec_A_set": globs.ec_A_set,
|
101 |
-
"5_ec_B_set": globs.ec_B_set,
|
102 |
-
"6_ec_C_set": globs.ec_C_set,
|
103 |
-
"7_l_ON_h_set": globs.l_ON_h_set,
|
104 |
-
"7_l_ON_m_set": globs.l_ON_m_set,
|
105 |
-
"8_l_OFF_h_set": globs.l_OFF_h_set,
|
106 |
-
"8_l_OFF_m_set": globs.l_OFF_m_set,
|
107 |
-
"9_ec_t_Voz_set": globs.ec_t_Voz_set,
|
108 |
-
"eep_set": globs.eep_set,
|
109 |
-
"err": err
|
110 |
-
}
|
111 |
-
|
112 |
-
# Возвращаем JSON-объект
|
113 |
-
return jsonify(response)
|
114 |
-
|
115 |
-
|
|
|
1 |
import sqlite3
|
2 |
|
3 |
+
|
|
|
|
|
|
|
4 |
|
5 |
def create_database_and_table():
|
6 |
# Создание подключения к базе данных SQLite
|
|
|
37 |
|
38 |
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|