|
@@ -25,6 +25,8 @@ def table_parser(data, cel_data, start_data, num = 0):
|
|
|
all_table += 'height: ' + table_height.groups()[0] + 'px;'
|
|
all_table += 'height: ' + table_height.groups()[0] + 'px;'
|
|
|
else:
|
|
else:
|
|
|
all_table += 'height: ' + table_height.groups()[0] + ';'
|
|
all_table += 'height: ' + table_height.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ # width, height
|
|
|
|
|
|
|
|
table_align = re.search("<table ?align=((?:(?!>).)*)>", data)
|
|
table_align = re.search("<table ?align=((?:(?!>).)*)>", data)
|
|
|
if table_align:
|
|
if table_align:
|
|
@@ -50,6 +52,8 @@ def table_parser(data, cel_data, start_data, num = 0):
|
|
|
row_style += 'text-align: center;'
|
|
row_style += 'text-align: center;'
|
|
|
else:
|
|
else:
|
|
|
row_style += 'text-align: left;'
|
|
row_style += 'text-align: left;'
|
|
|
|
|
+
|
|
|
|
|
+ # align
|
|
|
|
|
|
|
|
table_cel = re.search("<-((?:(?!>).)*)>", data)
|
|
table_cel = re.search("<-((?:(?!>).)*)>", data)
|
|
|
if table_cel:
|
|
if table_cel:
|
|
@@ -61,9 +65,17 @@ def table_parser(data, cel_data, start_data, num = 0):
|
|
|
if table_row:
|
|
if table_row:
|
|
|
row = 'rowspan="' + table_row.groups()[0] + '"'
|
|
row = 'rowspan="' + table_row.groups()[0] + '"'
|
|
|
|
|
|
|
|
|
|
+ # <>
|
|
|
|
|
+
|
|
|
row_bgcolor = re.search("<rowbgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
row_bgcolor = re.search("<rowbgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
if row_bgcolor:
|
|
if row_bgcolor:
|
|
|
row_style += 'background: ' + row_bgcolor.groups()[0] + ';'
|
|
row_style += 'background: ' + row_bgcolor.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ row_bgcolor = re.search("<rowcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
|
|
+ if row_bgcolor:
|
|
|
|
|
+ row_style += 'color: ' + row_bgcolor.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ # row
|
|
|
|
|
|
|
|
table_border = re.search("<table ?bordercolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
table_border = re.search("<table ?bordercolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
if table_border:
|
|
if table_border:
|
|
@@ -72,10 +84,20 @@ def table_parser(data, cel_data, start_data, num = 0):
|
|
|
table_bgcolor = re.search("<table ?bgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
table_bgcolor = re.search("<table ?bgcolor=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
if table_bgcolor:
|
|
if table_bgcolor:
|
|
|
all_table += 'background: ' + table_bgcolor.groups()[0] + ';'
|
|
all_table += 'background: ' + table_bgcolor.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ table_bgcolor = re.search("<table ?color=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
|
|
+ if table_bgcolor:
|
|
|
|
|
+ all_table += 'color: ' + table_bgcolor.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ # all
|
|
|
|
|
|
|
|
bgcolor = re.search("<(?:bgcolor=)?(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
bgcolor = re.search("<(?:bgcolor=)?(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
if bgcolor:
|
|
if bgcolor:
|
|
|
cel_style += 'background: ' + bgcolor.groups()[0] + ';'
|
|
cel_style += 'background: ' + bgcolor.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ bgcolor = re.search("<color=(#(?:[0-9a-f-A-F]{3}){1,2}|\w+)>", data)
|
|
|
|
|
+ if bgcolor:
|
|
|
|
|
+ cel_style += 'color: ' + bgcolor.groups()[0] + ';'
|
|
|
|
|
|
|
|
cel_width = re.search("<width=((?:(?!>).)*)>", data)
|
|
cel_width = re.search("<width=((?:(?!>).)*)>", data)
|
|
|
if cel_width:
|
|
if cel_width:
|
|
@@ -90,6 +112,8 @@ def table_parser(data, cel_data, start_data, num = 0):
|
|
|
cel_style += 'height: ' + cel_height.groups()[0] + 'px;'
|
|
cel_style += 'height: ' + cel_height.groups()[0] + 'px;'
|
|
|
else:
|
|
else:
|
|
|
cel_style += 'height: ' + cel_height.groups()[0] + ';'
|
|
cel_style += 'height: ' + cel_height.groups()[0] + ';'
|
|
|
|
|
+
|
|
|
|
|
+ # cel
|
|
|
|
|
|
|
|
text_right = re.search("<\)>", data)
|
|
text_right = re.search("<\)>", data)
|
|
|
text_center = re.search("<:>", data)
|
|
text_center = re.search("<:>", data)
|
|
@@ -831,13 +855,28 @@ def namu(conn, data, title, main_num, include_num):
|
|
|
inter_data = re.search('^inter:((?:(?!:).)+):((?:(?!\]\]|\|).)+)', main_link)
|
|
inter_data = re.search('^inter:((?:(?!:).)+):((?:(?!\]\]|\|).)+)', main_link)
|
|
|
inter_data = inter_data.groups()
|
|
inter_data = inter_data.groups()
|
|
|
|
|
|
|
|
- curs.execute('select link from inter where title = ?', [inter_data[0]])
|
|
|
|
|
|
|
+ curs.execute('select link, icon from inter where title = ?', [inter_data[0]])
|
|
|
inter = curs.fetchall()
|
|
inter = curs.fetchall()
|
|
|
if inter:
|
|
if inter:
|
|
|
|
|
+ if inter[0][1] != '':
|
|
|
|
|
+ inter_view = inter[0][1]
|
|
|
|
|
+ else:
|
|
|
|
|
+ inter_view = inter_data[0] + ':'
|
|
|
|
|
+
|
|
|
if see_link != main_link:
|
|
if see_link != main_link:
|
|
|
- data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_data[0] + ':' + see_link + '</a>', data, 1)
|
|
|
|
|
|
|
+ data = re.sub(
|
|
|
|
|
+ '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
|
|
|
|
|
+ '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + see_link + '</a>',
|
|
|
|
|
+ data,
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
else:
|
|
else:
|
|
|
- data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_data[0] + ':' + inter_data[1] + '</a>', data, 1)
|
|
|
|
|
|
|
+ data = re.sub(
|
|
|
|
|
+ '\[\[((?:(?!\[\[|\]\]).)+)\]\]',
|
|
|
|
|
+ '<a id="inside" href="' + inter[0][0] + inter_data[1] + '">' + inter_view + inter_data[1] + '</a>',
|
|
|
|
|
+ data,
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
else:
|
|
else:
|
|
|
data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', 'Not exist', data, 1)
|
|
data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', 'Not exist', data, 1)
|
|
|
elif re.search('^\/', main_link):
|
|
elif re.search('^\/', main_link):
|