Skip to content

Commit e7d1c05

Browse files
committed
1 parent a9be6b1 commit e7d1c05

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

zh.diff

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
From 5e70bc02f358a0ab63f09cbcd969a0e103ea0508 Mon Sep 17 00:00:00 2001
1+
From 938d6be7ebcb2a640ca67263847c07b1ac813c82 Mon Sep 17 00:00:00 2001
22
From: myfreeer <[email protected]>
3-
Date: Sat, 14 Mar 2020 12:32:04 +0800
3+
Date: Fri, 31 Dec 2021 21:24:02 +0800
44
Subject: [PATCH] source: use zh localized version
55

66
---
7-
Makefile | 54 ++++++++++++------------
7+
Makefile | 58 ++++++++++++------------
88
commands/preprocess.py | 21 +++++----
99
commands/preprocess_cssless.py | 4 +-
1010
gadgets/standard_revisions_tests/base.py | 2 +-
@@ -14,12 +14,21 @@ Subject: [PATCH] source: use zh localized version
1414
preprocess.py | 8 ++--
1515
tests/test_preprocess.py | 2 +-
1616
tests/test_preprocess_cssless.py | 2 +-
17-
10 files changed, 52 insertions(+), 49 deletions(-)
17+
10 files changed, 54 insertions(+), 51 deletions(-)
1818

1919
diff --git a/Makefile b/Makefile
20-
index 22d5596..559fe38 100644
20+
index 798b79e..e1b4e96 100644
2121
--- a/Makefile
2222
+++ b/Makefile
23+
@@ -28,7 +28,7 @@ qhelpgenerator = qhelpgenerator
24+
25+
#Version
26+
27+
-VERSION=20211127
28+
+VERSION=20211231
29+
30+
#STANDARD RULES
31+
2332
@@ -100,18 +100,18 @@ install: all
2433
popd > /dev/null
2534

@@ -140,19 +149,20 @@ index 22d5596..559fe38 100644
140149
+ --span-hosts --domains=zh.cppreference.com,upload.cppreference.com \
141150
--reject-regex $$regex \
142151
- --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 \
145153
- https://en.cppreference.com/w/ ; \
154+
+ --timeout=5 --tries=180 --no-verbose \
155+
+ --retry-connrefused --waitretry=2 --read-timeout=13 \
146156
+ https://zh.cppreference.com/w/ ; \
147157
popd > /dev/null
148158

149159
- ./export.py --url=https://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
150160
+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
151161
diff --git a/commands/preprocess.py b/commands/preprocess.py
152-
index 2f8ff4c..43a527a 100644
162+
index f6627ef..6785463 100644
153163
--- a/commands/preprocess.py
154164
+++ b/commands/preprocess.py
155-
@@ -42,23 +42,23 @@ def rearrange_archive(root):
165+
@@ -43,23 +43,23 @@ def rearrange_archive(root):
156166
# rearrange the archive. {root} here is output/reference
157167

158168
# before
@@ -182,7 +192,7 @@ index 2f8ff4c..43a527a 100644
182192
path = os.path.join(root, lang + ".cppreference.com/")
183193
src_html_path = path + "w/"
184194
src_data_path = path + "mwiki/"
185-
@@ -81,7 +81,7 @@ def rearrange_archive(root):
195+
@@ -82,7 +82,7 @@ def rearrange_archive(root):
186196
shutil.copy(os.path.join(path, 'favicon.ico'), data_path)
187197

188198
# remove what's left
@@ -191,7 +201,7 @@ index 2f8ff4c..43a527a 100644
191201

192202
# remove the XML source file
193203
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):
195205

196206
# make custom footer
197207
def add_footer(html, root, fn):
@@ -203,7 +213,7 @@ index 2f8ff4c..43a527a 100644
203213
for child in footer.getchildren():
204214
id = child.get('id')
205215
if id == 'cpp-navigation':
206-
@@ -377,7 +380,7 @@ def remove_unused_external(html):
216+
@@ -386,7 +389,7 @@ def remove_unused_external(html):
207217

208218

209219
def preprocess_html_file(root, fn, rename_map):
@@ -213,10 +223,10 @@ index 2f8ff4c..43a527a 100644
213223
output = io.StringIO()
214224

215225
diff --git a/commands/preprocess_cssless.py b/commands/preprocess_cssless.py
216-
index 8bf9142..2df1774 100644
226+
index e6f9e02..11170e3 100644
217227
--- a/commands/preprocess_cssless.py
218228
+++ 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
220230

221231

222232
def preprocess_html_merge_cssless(src_path, dst_path):
@@ -229,10 +239,10 @@ index 8bf9142..2df1774 100644
229239
root = etree.fromstring(stripped, parser)
230240

231241
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
233243
--- a/gadgets/standard_revisions_tests/base.py
234244
+++ 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
236246

237247
class Driver:
238248
def __init__(self):
@@ -242,7 +252,7 @@ index b780e8d..67266e1 100644
242252
driver.implicitly_wait(30)
243253
try:
244254
diff --git a/gadgets/sync_tests_mwiki.py b/gadgets/sync_tests_mwiki.py
245-
index 9aa3fc7..13294ec 100755
255+
index b9e1337..41eae97 100755
246256
--- a/gadgets/sync_tests_mwiki.py
247257
+++ b/gadgets/sync_tests_mwiki.py
248258
@@ -114,7 +114,7 @@ def perform_sync(url, direction, dest_root, title_filter, user, password,
@@ -255,10 +265,10 @@ index 9aa3fc7..13294ec 100755
255265
pywikibot.config2.step = 100
256266
pywikibot.config2.put_throttle = 0
257267
diff --git a/index2ddg.py b/index2ddg.py
258-
index f8c9e12..4bdc3d0 100755
268+
index 71d15ed..a22ccf1 100755
259269
--- a/index2ddg.py
260270
+++ 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,
262272
abstract = abstract.replace('\n', '\\n')
263273
line += abstract + '\t'
264274
# source url
@@ -267,7 +277,7 @@ index f8c9e12..4bdc3d0 100755
267277
out.write(line)
268278

269279
build_redirects(redirects, item_ident, item_type)
270-
@@ -580,7 +580,7 @@ def main():
280+
@@ -582,7 +582,7 @@ def main():
271281
# i+=1
272282

273283
root = e.parse(os.path.join(args.reference, fn),
@@ -290,10 +300,10 @@ index fb8b976..e9657a4 100644
290300
res += '{0}</a></span>] <span class="mark">{1}</span>\n'.format(
291301
full_link, mark)
292302
diff --git a/preprocess.py b/preprocess.py
293-
index a04abd2..95823b6 100755
303+
index 1fb4419..c2513aa 100755
294304
--- a/preprocess.py
295305
+++ b/preprocess.py
296-
@@ -35,12 +35,12 @@ def main():
306+
@@ -36,12 +36,12 @@ def main():
297307
help='Destination folder to put preprocessed archive to')
298308
args = parser.parse_args()
299309

@@ -311,10 +321,10 @@ index a04abd2..95823b6 100755
311321
preprocess.rearrange_archive(root)
312322

313323
diff --git a/tests/test_preprocess.py b/tests/test_preprocess.py
314-
index 5233199..38ec845 100644
324+
index 3c0c952..b8d03d2 100644
315325
--- a/tests/test_preprocess.py
316326
+++ b/tests/test_preprocess.py
317-
@@ -256,7 +256,7 @@ class TestPreprocessHtml(unittest.TestCase):
327+
@@ -258,7 +258,7 @@ class TestPreprocessHtml(unittest.TestCase):
318328
self.testdata = os.path.join(os.path.dirname(__file__),
319329
'preprocess_data')
320330
infile = os.path.join(self.testdata, "fabs.html")
@@ -324,10 +334,10 @@ index 5233199..38ec845 100644
324334

325335
# Check whether the HTML matches the contents of the specified test data
326336
diff --git a/tests/test_preprocess_cssless.py b/tests/test_preprocess_cssless.py
327-
index 0b9f580..ab6dddb 100644
337+
index 64864cc..b48628b 100644
328338
--- a/tests/test_preprocess_cssless.py
329339
+++ b/tests/test_preprocess_cssless.py
330-
@@ -81,7 +81,7 @@ class HTMLTestBase(unittest.TestCase):
340+
@@ -83,7 +83,7 @@ class HTMLTestBase(unittest.TestCase):
331341
expected_output = \
332342
'<html><body>{0}</body></html>'.format(expected_output)
333343

@@ -337,5 +347,5 @@ index 0b9f580..ab6dddb 100644
337347

338348
root = function(root)
339349
--
340-
2.25.0
350+
2.30.0
341351

0 commit comments

Comments
 (0)