Ver código fonte

하나 더 분리하고 잔다

Surplus_UP (2DU) 7 anos atrás
pai
commit
00624f88f4
2 arquivos alterados com 20 adições e 14 exclusões
  1. 1 14
      app.py
  2. 19 0
      route/not_close_topic.py

+ 1 - 14
app.py

@@ -350,20 +350,7 @@ def setting(num = 0):
 
 @app.route('/not_close_topic')
 def not_close_topic():
-    div = '<ul>'
-    
-    curs.execute('select title, sub from rd where stop != "O" order by date desc')
-    n_list = curs.fetchall()
-    for data in n_list:
-        div += '<li><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + html.escape(data[0]) + ' (' + data[1] + ')</a></li>'
-            
-    div += '</ul>'
-
-    return easy_minify(flask.render_template(skin_check(), 
-        imp = [load_lang('open_discussion_list'), wiki_set(), custom(), other2([0, 0])],
-        data = div,
-        menu = [['manager', load_lang('return')]]
-    ))
+    return not_close_topic_2(conn)
 
 @app.route('/image/<name>')
 def image_view(name = None):

+ 19 - 0
route/not_close_topic.py

@@ -0,0 +1,19 @@
+from .tool.func import *
+
+def not_close_topic_2(conn):
+    curs = conn.cursor()
+
+    div = '<ul>'
+    
+    curs.execute('select title, sub from rd where stop != "O" order by date desc')
+    n_list = curs.fetchall()
+    for data in n_list:
+        div += '<li><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + html.escape(data[0]) + ' (' + data[1] + ')</a></li>'
+            
+    div += '</ul>'
+
+    return easy_minify(flask.render_template(skin_check(), 
+        imp = [load_lang('open_discussion_list'), wiki_set(), custom(), other2([0, 0])],
+        data = div,
+        menu = [['manager', load_lang('return')]]
+    ))