list_please.py 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. from .tool.func import *
  2. def list_please(arg_num = 1):
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. sql_num = (arg_num * 50 - 50) if arg_num * 50 > 0 else 0
  6. curs.execute(db_change('select data from other where name = "count_all_title"'))
  7. if int(curs.fetchall()[0][0]) > 30000:
  8. return re_error('/error/25')
  9. div = '<ul class="opennamu_ul">'
  10. curs.execute(db_change("select distinct title, link from back where type = 'no' order by title asc limit ?, 50"), [sql_num])
  11. data_list = curs.fetchall()
  12. for data in data_list:
  13. div += '' + \
  14. '<li>' + \
  15. '<a class="opennamu_not_exist_link" href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> ' + \
  16. '<a href="/w/' + url_pas(data[1]) + '">(' + html.escape(data[1]) + ')</a>' + \
  17. '</li>' + \
  18. ''
  19. div += '</ul>' + next_fix('/list/document/need/', arg_num, data_list)
  20. return easy_minify(flask.render_template(skin_check(),
  21. imp = [load_lang('need_document'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  22. data = div,
  23. menu = [['other', load_lang('return')]]
  24. ))