|
@@ -1,4 +1,5 @@
|
|
|
from .tool.func import *
|
|
from .tool.func import *
|
|
|
|
|
+from . import edit_delete
|
|
|
|
|
|
|
|
def edit_many_delete_2(conn, app_var):
|
|
def edit_many_delete_2(conn, app_var):
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
@@ -10,44 +11,9 @@ def edit_many_delete_2(conn, app_var):
|
|
|
if flask.request.method == 'POST':
|
|
if flask.request.method == 'POST':
|
|
|
all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
|
|
all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
|
|
|
for name in all_title:
|
|
for name in all_title:
|
|
|
- curs.execute(db_change("select data from data where title = ?"), [name])
|
|
|
|
|
- data = curs.fetchall()
|
|
|
|
|
- if data:
|
|
|
|
|
- today = get_time()
|
|
|
|
|
- leng = '-' + str(len(data[0][0]))
|
|
|
|
|
|
|
+ edit_delete.edit_delete_2(conn, name, app_var)
|
|
|
|
|
|
|
|
- history_plus(
|
|
|
|
|
- name,
|
|
|
|
|
- '',
|
|
|
|
|
- today,
|
|
|
|
|
- ip,
|
|
|
|
|
- flask.request.form.get('send', ''),
|
|
|
|
|
- leng,
|
|
|
|
|
- 'delete'
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- curs.execute(db_change("select title, link from back where title = ? and not type = 'cat' and not type = 'no'"), [name])
|
|
|
|
|
- for data in curs.fetchall():
|
|
|
|
|
- curs.execute(db_change("insert into back (title, link, type) values (?, ?, 'no')"), [data[0], data[1]])
|
|
|
|
|
-
|
|
|
|
|
- curs.execute(db_change("delete from back where link = ?"), [name])
|
|
|
|
|
- curs.execute(db_change("delete from data where title = ?"), [name])
|
|
|
|
|
- conn.commit()
|
|
|
|
|
-
|
|
|
|
|
- file_check = re.search(r'^file:(.+)\.(.+)$', name)
|
|
|
|
|
- if file_check:
|
|
|
|
|
- file_check = file_check.groups()
|
|
|
|
|
- file_directory = os.path.join(
|
|
|
|
|
- app_var['path_data_image'],
|
|
|
|
|
- sha224_replace(file_check[0]) + '.' + file_check[1]
|
|
|
|
|
- )
|
|
|
|
|
- if os.path.exists(file_directory):
|
|
|
|
|
- os.remove(file_directory)
|
|
|
|
|
-
|
|
|
|
|
- curs.execute(db_change('select data from other where name = "count_all_title"'))
|
|
|
|
|
- curs.execute(db_change("update other set data = ? where name = 'count_all_title'"), [str(int(curs.fetchall()[0][0]) - 1)])
|
|
|
|
|
-
|
|
|
|
|
- return redirect('/recent_changes')
|
|
|
|
|
|
|
+ return redirect('/recent_changes')
|
|
|
else:
|
|
else:
|
|
|
return easy_minify(flask.render_template(skin_check(),
|
|
return easy_minify(flask.render_template(skin_check(),
|
|
|
imp = [load_lang('many_delete'), wiki_set(), custom(), other2([0, 0])],
|
|
imp = [load_lang('many_delete'), wiki_set(), custom(), other2([0, 0])],
|