|
@@ -12,12 +12,13 @@ from set_mark.indent import indent
|
|
|
from set_mark.footnote import footnote
|
|
from set_mark.footnote import footnote
|
|
|
from set_mark.table import table
|
|
from set_mark.table import table
|
|
|
from set_mark.end import end
|
|
from set_mark.end import end
|
|
|
|
|
+
|
|
|
import re
|
|
import re
|
|
|
import html
|
|
import html
|
|
|
import sqlite3
|
|
import sqlite3
|
|
|
from urllib import parse
|
|
from urllib import parse
|
|
|
import time
|
|
import time
|
|
|
-import asyncio
|
|
|
|
|
|
|
+import threading
|
|
|
|
|
|
|
|
def send_p(d):
|
|
def send_p(d):
|
|
|
d = html.escape(d)
|
|
d = html.escape(d)
|
|
@@ -32,8 +33,9 @@ def send_p(d):
|
|
|
def url_pas(data):
|
|
def url_pas(data):
|
|
|
return parse.quote(data).replace('/','%2F')
|
|
return parse.quote(data).replace('/','%2F')
|
|
|
|
|
|
|
|
-async def plusing(conn, name, link, backtype):
|
|
|
|
|
|
|
+def plusing(conn, name, link, backtype):
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
|
|
|
+
|
|
|
curs.execute("select title from back where title = ? and link = ? and type = ?", [link, name, backtype])
|
|
curs.execute("select title from back where title = ? and link = ? and type = ?", [link, name, backtype])
|
|
|
if not curs.fetchall():
|
|
if not curs.fetchall():
|
|
|
curs.execute("insert into back (title, link, type) values (?, ?, ?)", [link, name, backtype])
|
|
curs.execute("insert into back (title, link, type) values (?, ?, ?)", [link, name, backtype])
|
|
@@ -74,11 +76,11 @@ def namumark(conn, title, data, num, in_c, toc_y):
|
|
|
data = end(data, category)
|
|
data = end(data, category)
|
|
|
|
|
|
|
|
if(num == 1):
|
|
if(num == 1):
|
|
|
- asyncio.set_event_loop(asyncio.new_event_loop())
|
|
|
|
|
- loop = asyncio.get_event_loop()
|
|
|
|
|
for d4 in backlink:
|
|
for d4 in backlink:
|
|
|
- loop.run_until_complete(plusing(conn, d4[0], d4[1], d4[2]))
|
|
|
|
|
- loop.close()
|
|
|
|
|
|
|
+ t = threading.Thread(target = plusing, args = [conn, d4[0], d4[1], d4[2]])
|
|
|
|
|
+ t.start()
|
|
|
|
|
+ t.join()
|
|
|
|
|
+
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
|
|
|
return data
|
|
return data
|