DmitrMakeev commited on
Commit
966ba02
·
verified ·
1 Parent(s): d46c094

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -180,6 +180,7 @@ def init_settings_db():
180
  api_key_auth TEXT,
181
  api_key_apps_vk TEXT,
182
  vk_api_key TEXT,
 
183
  senler_token TEXT,
184
  wa_ak TEXT,
185
  wa_api_key TEXT,
@@ -200,13 +201,14 @@ DATABASE_NEW = 'data_gc.db'
200
 
201
 
202
  def load_settings():
203
- global api_key_auth, api_key_apps_vk, vk_api_key
204
  global senler_token, wa_ak, wa_api_key, curators, call_api_key
205
 
206
  default_settings = {
207
  'api_key_auth': '',
208
  'api_key_apps_vk': '',
209
  'vk_api_key': '',
 
210
  'senler_token': '',
211
  'wa_ak': '',
212
  'wa_api_key': '',
@@ -229,6 +231,7 @@ def load_settings():
229
  api_key_auth = settings['api_key_auth']
230
  api_key_apps_vk = settings['api_key_apps_vk']
231
  vk_api_key = settings['vk_api_key']
 
232
  senler_token = settings['senler_token']
233
  wa_ak = settings['wa_ak']
234
  wa_api_key = settings['wa_api_key']
@@ -239,6 +242,7 @@ def load_settings():
239
  print(f"wa_api_key: {wa_api_key}")
240
  print(f"wa_ak: {wa_ak}")
241
  print(f"vk_api_key: {vk_api_key}")
 
242
  print(f"senler_token: {senler_token}")
243
 
244
  print(f"api_key_auth: {api_key_auth}")
@@ -256,7 +260,7 @@ def load_settings():
256
  load_settings()
257
 
258
  def save_settings(settings_dict):
259
- global api_key_auth, api_key_apps_vk, vk_api_key
260
  global senler_token, wa_ak, wa_api_key, curators, call_api_key
261
 
262
  # Удаляем api_key_sys из словаря перед сохранением
@@ -274,12 +278,13 @@ def save_settings(settings_dict):
274
  # Обновляем запись
275
  cursor.execute('''
276
  UPDATE settings SET
277
- api_key_auth = ?, api_key_apps_vk = ?, vk_api_key = ?,
278
  senler_token = ?, wa_ak = ?, wa_api_key = ?, curators = ?, call_api_key = ?
279
  ''', (
280
  settings_dict.get('api_key_auth', ''),
281
  settings_dict.get('api_key_apps_vk', ''),
282
  settings_dict.get('vk_api_key', ''),
 
283
  settings_dict.get('senler_token', ''),
284
  settings_dict.get('wa_ak', ''),
285
  settings_dict.get('wa_api_key', ''),
@@ -290,13 +295,14 @@ def save_settings(settings_dict):
290
  # Создаем новую запись
291
  cursor.execute('''
292
  INSERT INTO settings (
293
- api_key_auth, api_key_apps_vk, vk_api_key, senler_token,
294
  wa_ak, wa_api_key, curators, call_api_key
295
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
296
  ''', (
297
  settings_dict.get('api_key_auth', ''),
298
  settings_dict.get('api_key_apps_vk', ''),
299
  settings_dict.get('vk_api_key', ''),
 
300
  settings_dict.get('senler_token', ''),
301
  settings_dict.get('wa_ak', ''),
302
  settings_dict.get('wa_api_key', ''),
@@ -311,6 +317,7 @@ def save_settings(settings_dict):
311
  api_key_auth = settings_dict.get('api_key_auth', '')
312
  api_key_apps_vk = settings_dict.get('api_key_apps_vk', '')
313
  vk_api_key = settings_dict.get('vk_api_key', '')
 
314
  senler_token = settings_dict.get('senler_token', '')
315
  wa_ak = settings_dict.get('wa_ak', '')
316
  wa_api_key = settings_dict.get('wa_api_key', '')
@@ -321,6 +328,7 @@ def save_settings(settings_dict):
321
  print(f"wa_api_key: {wa_api_key}")
322
  print(f"wa_ak: {wa_ak}")
323
  print(f"vk_api_key: {vk_api_key}")
 
324
  print(f"senler_token: {senler_token}")
325
 
326
  print(f"api_key_auth: {api_key_auth}")
 
180
  api_key_auth TEXT,
181
  api_key_apps_vk TEXT,
182
  vk_api_key TEXT,
183
+ key_callback_vk TEXT,
184
  senler_token TEXT,
185
  wa_ak TEXT,
186
  wa_api_key TEXT,
 
201
 
202
 
203
  def load_settings():
204
+ global api_key_auth, api_key_apps_vk, vk_api_key, key_callback_vk
205
  global senler_token, wa_ak, wa_api_key, curators, call_api_key
206
 
207
  default_settings = {
208
  'api_key_auth': '',
209
  'api_key_apps_vk': '',
210
  'vk_api_key': '',
211
+ 'key_callback_vk': '',
212
  'senler_token': '',
213
  'wa_ak': '',
214
  'wa_api_key': '',
 
231
  api_key_auth = settings['api_key_auth']
232
  api_key_apps_vk = settings['api_key_apps_vk']
233
  vk_api_key = settings['vk_api_key']
234
+ key_callback_vk = settings['key_callback_vk']
235
  senler_token = settings['senler_token']
236
  wa_ak = settings['wa_ak']
237
  wa_api_key = settings['wa_api_key']
 
242
  print(f"wa_api_key: {wa_api_key}")
243
  print(f"wa_ak: {wa_ak}")
244
  print(f"vk_api_key: {vk_api_key}")
245
+ print(f"key_callback_vk: {key_callback_vk}")
246
  print(f"senler_token: {senler_token}")
247
 
248
  print(f"api_key_auth: {api_key_auth}")
 
260
  load_settings()
261
 
262
  def save_settings(settings_dict):
263
+ global api_key_auth, api_key_apps_vk, key_callback_vk
264
  global senler_token, wa_ak, wa_api_key, curators, call_api_key
265
 
266
  # Удаляем api_key_sys из словаря перед сохранением
 
278
  # Обновляем запись
279
  cursor.execute('''
280
  UPDATE settings SET
281
+ api_key_auth = ?, api_key_apps_vk = ?, vk_api_key = ?, vk_api_key = ?, key_callback_vk = ?,
282
  senler_token = ?, wa_ak = ?, wa_api_key = ?, curators = ?, call_api_key = ?
283
  ''', (
284
  settings_dict.get('api_key_auth', ''),
285
  settings_dict.get('api_key_apps_vk', ''),
286
  settings_dict.get('vk_api_key', ''),
287
+ settings_dict.get('key_callback_vk', ''),
288
  settings_dict.get('senler_token', ''),
289
  settings_dict.get('wa_ak', ''),
290
  settings_dict.get('wa_api_key', ''),
 
295
  # Создаем новую запись
296
  cursor.execute('''
297
  INSERT INTO settings (
298
+ api_key_auth, api_key_apps_vk, vk_api_key, key_callback_vk, senler_token,
299
  wa_ak, wa_api_key, curators, call_api_key
300
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
301
  ''', (
302
  settings_dict.get('api_key_auth', ''),
303
  settings_dict.get('api_key_apps_vk', ''),
304
  settings_dict.get('vk_api_key', ''),
305
+ settings_dict.get('key_callback_vk', ''),
306
  settings_dict.get('senler_token', ''),
307
  settings_dict.get('wa_ak', ''),
308
  settings_dict.get('wa_api_key', ''),
 
317
  api_key_auth = settings_dict.get('api_key_auth', '')
318
  api_key_apps_vk = settings_dict.get('api_key_apps_vk', '')
319
  vk_api_key = settings_dict.get('vk_api_key', '')
320
+ key_callback_vk = settings_dict.get('key_callback_vk', '')
321
  senler_token = settings_dict.get('senler_token', '')
322
  wa_ak = settings_dict.get('wa_ak', '')
323
  wa_api_key = settings_dict.get('wa_api_key', '')
 
328
  print(f"wa_api_key: {wa_api_key}")
329
  print(f"wa_ak: {wa_ak}")
330
  print(f"vk_api_key: {vk_api_key}")
331
+ print(f"key_callback_vk: {key_callback_vk}")
332
  print(f"senler_token: {senler_token}")
333
 
334
  print(f"api_key_auth: {api_key_auth}")