list_long_page.py 1010 B

12345678910111213141516171819202122232425
  1. from .tool.func import *
  2. def list_long_page_2(tool):
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. curs.execute(db_change('select data from other where name = "count_all_title"'))
  6. if int(curs.fetchall()[0][0]) > 30000:
  7. return re_error('/error/25')
  8. div = '<ul class="inside_ul">'
  9. select_data = 'desc' if tool == 'long_page' else 'asc'
  10. title = 'long_page' if tool == 'long_page' else 'short_page'
  11. curs.execute(db_change("select title, length(data) from data order by length(data) " + select_data + " limit 50"))
  12. for data in curs.fetchall():
  13. div += '<li>' + str(data[1]) + ' : <a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a></li>'
  14. div += '</ul>'
  15. return easy_minify(flask.render_template(skin_check(),
  16. imp = [load_lang(title), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  17. data = div,
  18. menu = [['other', load_lang('return')]]
  19. ))