1
- From 5e70bc02f358a0ab63f09cbcd969a0e103ea0508 Mon Sep 17 00:00:00 2001
1
+ From 938d6be7ebcb2a640ca67263847c07b1ac813c82 Mon Sep 17 00:00:00 2001
2
2
From: myfreeer <
[email protected] >
3
- Date: Sat, 14 Mar 2020 12:32:04 +0800
3
+ Date: Fri, 31 Dec 2021 21:24:02 +0800
4
4
Subject: [PATCH] source: use zh localized version
5
5
6
6
---
7
- Makefile | 54 ++++++++++++------------
7
+ Makefile | 58 ++++++++++++------------
8
8
commands/preprocess.py | 21 +++++----
9
9
commands/preprocess_cssless.py | 4 +-
10
10
gadgets/standard_revisions_tests/base.py | 2 +-
@@ -14,12 +14,21 @@ Subject: [PATCH] source: use zh localized version
14
14
preprocess.py | 8 ++--
15
15
tests/test_preprocess.py | 2 +-
16
16
tests/test_preprocess_cssless.py | 2 +-
17
- 10 files changed, 52 insertions(+), 49 deletions(-)
17
+ 10 files changed, 54 insertions(+), 51 deletions(-)
18
18
19
19
diff --git a/Makefile b/Makefile
20
- index 22d5596..559fe38 100644
20
+ index 798b79e..e1b4e96 100644
21
21
--- a/Makefile
22
22
+++ b/Makefile
23
+ @@ -28,7 +28,7 @@ qhelpgenerator = qhelpgenerator
24
+
25
+ #Version
26
+
27
+ - VERSION=20211127
28
+ + VERSION=20211231
29
+
30
+ #STANDARD RULES
31
+
23
32
@@ -100,18 +100,18 @@ install: all
24
33
popd > /dev/null
25
34
@@ -140,19 +149,20 @@ index 22d5596..559fe38 100644
140
149
+ --span-hosts --domains=zh.cppreference.com,upload.cppreference.com \
141
150
--reject-regex $$regex \
142
151
- --timeout=5 --tries=50 --no-verbose \
143
- + --timeout=5 --tries=150 --no-verbose \
144
- --retry-connrefused --waitretry=10 --read-timeout=20 \
152
+ - --retry-connrefused --waitretry=10 --read-timeout=20 \
145
153
- https://en.cppreference.com/w/ ; \
154
+ + --timeout=5 --tries=180 --no-verbose \
155
+ + --retry-connrefused --waitretry=2 --read-timeout=13 \
146
156
+ https://zh.cppreference.com/w/ ; \
147
157
popd > /dev/null
148
158
149
159
- ./export.py --url=https://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
150
160
+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
151
161
diff --git a/commands/preprocess.py b/commands/preprocess.py
152
- index 2f8ff4c..43a527a 100644
162
+ index f6627ef..6785463 100644
153
163
--- a/commands/preprocess.py
154
164
+++ b/commands/preprocess.py
155
- @@ -42 ,23 +42 ,23 @@ def rearrange_archive(root):
165
+ @@ -43 ,23 +43 ,23 @@ def rearrange_archive(root):
156
166
# rearrange the archive. {root} here is output/reference
157
167
158
168
# before
@@ -182,7 +192,7 @@ index 2f8ff4c..43a527a 100644
182
192
path = os.path.join(root, lang + ".cppreference.com/")
183
193
src_html_path = path + "w/"
184
194
src_data_path = path + "mwiki/"
185
- @@ -81 ,7 +81 ,7 @@ def rearrange_archive(root):
195
+ @@ -82 ,7 +82 ,7 @@ def rearrange_archive(root):
186
196
shutil.copy(os.path.join(path, 'favicon.ico'), data_path)
187
197
188
198
# remove what's left
@@ -191,7 +201,7 @@ index 2f8ff4c..43a527a 100644
191
201
192
202
# remove the XML source file
193
203
for fn in fnmatch.filter(os.listdir(root), 'cppreference-export*.xml'):
194
- @@ -341 ,7 +341 ,10 @@ def remove_fileinfo(html):
204
+ @@ -350 ,7 +350 ,10 @@ def remove_fileinfo(html):
195
205
196
206
# make custom footer
197
207
def add_footer(html, root, fn):
@@ -203,7 +213,7 @@ index 2f8ff4c..43a527a 100644
203
213
for child in footer.getchildren():
204
214
id = child.get('id')
205
215
if id == 'cpp-navigation':
206
- @@ -377 ,7 +380 ,7 @@ def remove_unused_external(html):
216
+ @@ -386 ,7 +389 ,7 @@ def remove_unused_external(html):
207
217
208
218
209
219
def preprocess_html_file(root, fn, rename_map):
@@ -213,10 +223,10 @@ index 2f8ff4c..43a527a 100644
213
223
output = io.StringIO()
214
224
215
225
diff --git a/commands/preprocess_cssless.py b/commands/preprocess_cssless.py
216
- index 8bf9142..2df1774 100644
226
+ index e6f9e02..11170e3 100644
217
227
--- a/commands/preprocess_cssless.py
218
228
+++ b/commands/preprocess_cssless.py
219
- @@ -28 ,9 +28 ,9 @@ from lxml.etree import strip_elements
229
+ @@ -29 ,9 +29 ,9 @@ from premailer import Premailer
220
230
221
231
222
232
def preprocess_html_merge_cssless(src_path, dst_path):
@@ -229,10 +239,10 @@ index 8bf9142..2df1774 100644
229
239
root = etree.fromstring(stripped, parser)
230
240
231
241
diff --git a/gadgets/standard_revisions_tests/base.py b/gadgets/standard_revisions_tests/base.py
232
- index b780e8d..67266e1 100644
242
+ index 8b1269c..43863ee 100644
233
243
--- a/gadgets/standard_revisions_tests/base.py
234
244
+++ b/gadgets/standard_revisions_tests/base.py
235
- @@ -24 ,7 +24 ,7 @@ from selenium.webdriver.support.ui import Select
245
+ @@ -25 ,7 +25 ,7 @@ from selenium.webdriver.support.ui import Select
236
246
237
247
class Driver:
238
248
def __init__(self):
@@ -242,7 +252,7 @@ index b780e8d..67266e1 100644
242
252
driver.implicitly_wait(30)
243
253
try:
244
254
diff --git a/gadgets/sync_tests_mwiki.py b/gadgets/sync_tests_mwiki.py
245
- index 9aa3fc7..13294ec 100755
255
+ index b9e1337..41eae97 100755
246
256
--- a/gadgets/sync_tests_mwiki.py
247
257
+++ b/gadgets/sync_tests_mwiki.py
248
258
@@ -114,7 +114,7 @@ def perform_sync(url, direction, dest_root, title_filter, user, password,
@@ -255,10 +265,10 @@ index 9aa3fc7..13294ec 100755
255
265
pywikibot.config2.step = 100
256
266
pywikibot.config2.put_throttle = 0
257
267
diff --git a/index2ddg.py b/index2ddg.py
258
- index f8c9e12..4bdc3d0 100755
268
+ index 71d15ed..a22ccf1 100755
259
269
--- a/index2ddg.py
260
270
+++ b/index2ddg.py
261
- @@ -465 ,7 +465 ,7 @@ def process_identifier(out, redirects, root, link, item_ident, item_type,
271
+ @@ -467 ,7 +467 ,7 @@ def process_identifier(out, redirects, root, link, item_ident, item_type,
262
272
abstract = abstract.replace('\n', '\\n')
263
273
line += abstract + '\t'
264
274
# source url
@@ -267,7 +277,7 @@ index f8c9e12..4bdc3d0 100755
267
277
out.write(line)
268
278
269
279
build_redirects(redirects, item_ident, item_type)
270
- @@ -580 ,7 +580 ,7 @@ def main():
280
+ @@ -582 ,7 +582 ,7 @@ def main():
271
281
# i+=1
272
282
273
283
root = e.parse(os.path.join(args.reference, fn),
@@ -290,10 +300,10 @@ index fb8b976..e9657a4 100644
290
300
res += '{0}</a></span>] <span class="mark">{1}</span>\n'.format(
291
301
full_link, mark)
292
302
diff --git a/preprocess.py b/preprocess.py
293
- index a04abd2..95823b6 100755
303
+ index 1fb4419..c2513aa 100755
294
304
--- a/preprocess.py
295
305
+++ b/preprocess.py
296
- @@ -35 ,12 +35 ,12 @@ def main():
306
+ @@ -36 ,12 +36 ,12 @@ def main():
297
307
help='Destination folder to put preprocessed archive to')
298
308
args = parser.parse_args()
299
309
@@ -311,10 +321,10 @@ index a04abd2..95823b6 100755
311
321
preprocess.rearrange_archive(root)
312
322
313
323
diff --git a/tests/test_preprocess.py b/tests/test_preprocess.py
314
- index 5233199..38ec845 100644
324
+ index 3c0c952..b8d03d2 100644
315
325
--- a/tests/test_preprocess.py
316
326
+++ b/tests/test_preprocess.py
317
- @@ -256 ,7 +256 ,7 @@ class TestPreprocessHtml(unittest.TestCase):
327
+ @@ -258 ,7 +258 ,7 @@ class TestPreprocessHtml(unittest.TestCase):
318
328
self.testdata = os.path.join(os.path.dirname(__file__),
319
329
'preprocess_data')
320
330
infile = os.path.join(self.testdata, "fabs.html")
@@ -324,10 +334,10 @@ index 5233199..38ec845 100644
324
334
325
335
# Check whether the HTML matches the contents of the specified test data
326
336
diff --git a/tests/test_preprocess_cssless.py b/tests/test_preprocess_cssless.py
327
- index 0b9f580..ab6dddb 100644
337
+ index 64864cc..b48628b 100644
328
338
--- a/tests/test_preprocess_cssless.py
329
339
+++ b/tests/test_preprocess_cssless.py
330
- @@ -81 ,7 +81 ,7 @@ class HTMLTestBase(unittest.TestCase):
340
+ @@ -83 ,7 +83 ,7 @@ class HTMLTestBase(unittest.TestCase):
331
341
expected_output = \
332
342
'<html><body>{0}</body></html>'.format(expected_output)
333
343
@@ -337,5 +347,5 @@ index 0b9f580..ab6dddb 100644
337
347
338
348
root = function(root)
339
349
- -
340
- 2.25 .0
350
+ 2.30 .0
341
351
0 commit comments