Kaynağa Gözat

add emer_tool option

잉여개발기 (SPDV) 3 yıl önce
ebeveyn
işleme
e89e69bbb3
2 değiştirilmiş dosya ile 15 ekleme ve 6 silme
  1. 14 0
      emergency_tool.py
  2. 1 6
      route/list_title_index.py

+ 14 - 0
emergency_tool.py

@@ -46,6 +46,8 @@ print('16. Delete 2FA password')
 print('17. Change markup')
 print('18. Change wiki access password')
 print('19. Forced update')
+print('20. Change domain')
+print('21. Change TLS')
 
 print('----')
 what_i_do = input('Select : ')
@@ -249,6 +251,18 @@ elif what_i_do == '19':
             os.system('del update.zip')
         else:
             print('Error : update failed')
+elif what_i_do == '20':
+    print('----')
+    domain = input('Domain (EX : 2du.pythonanywhere.com) : ')
+
+    curs.execute(db_change("update other set data = ? where name = 'domain'"), [domain])
+elif what_i_do == '21':
+    print('----')
+    tls_v = input('TLS (http) [http, https] : ')
+    if not tls_v in ['http', 'https']:
+        tls_v = 'http'
+
+    curs.execute(db_change("update other set data = ? where name = 'http_select'"), [tls_v])
 else:
     raise ValueError(what_i_do)
 

+ 1 - 6
route/list_title_index.py

@@ -30,12 +30,7 @@ def list_title_index_2():
             curs.execute(db_change('select data from other where name = "count_all_title"'))
             all_title = curs.fetchall()
             if int(all_title[0][0]) < 30000:
-                curs.execute(db_change("select count(*) from data"))
-                count = curs.fetchall()
-                if count:
-                    count_end += [count[0][0]]
-                else:
-                    count_end += [0]
+                count_end += [all_title[0][0]]
 
                 sql_list = ['category:', 'user:', 'file:']
                 for sql in sql_list: