1
+ From 2bc2732f6b1f75f12ca6246be8000698b50e97ae Mon Sep 17 00:00:00 2001
2
+ From: myfreeer <
[email protected] >
3
+ Date: Mon, 1 Oct 2018 11:55:02 +0800
4
+ Subject: [PATCH] source: use zh localized version
5
+
6
+ ---
7
+ Makefile | 14 +++++++-------
8
+ commands/preprocess.py | 18 ++++++++++--------
9
+ gadgets/standard_revisions-tests/base.py | 2 +-
10
+ gadgets/sync_tests_mwiki.py | 2 +-
11
+ index2ddg.py | 2 +-
12
+ index_transform/browser.py | 2 +-
13
+ preprocess.py | 8 ++++----
14
+ tests/test_preprocess.py | 10 +++++-----
15
+ 8 files changed, 30 insertions(+), 28 deletions(-)
16
+
1
17
diff --git a/Makefile b/Makefile
2
- index deadfe2..be18286 100644
18
+ index 9381549..6546a54 100644
3
19
--- a/Makefile
4
20
+++ b/Makefile
5
- @@ -230 ,7 +230 ,7 @@ indexes:
21
+ @@ -237 ,7 +237 ,7 @@ indexes:
6
22
./index2autolinker.py index-functions-c.xml output/indexes/autolink-c
7
23
./index2autolinker.py index-functions-cpp.xml output/indexes/autolink-cpp
8
24
@@ -11,7 +27,7 @@ index deadfe2..be18286 100644
11
27
source:
12
28
rm -rf "reference"
13
29
mkdir "reference"
14
- @@ -239 ,15 +239 ,15 @@ source:
30
+ @@ -246 ,15 +246 ,15 @@ source:
15
31
regex=".*index\\.php.*|.*/Special:.*|.*/Talk:.*" \
16
32
regex+="|.*/Help:.*|.*/File:.*|.*/Cppreference:.*" \
17
33
regex+="|.*/WhatLinksHere:.*|.*/Template:.*|.*/Category:.*" \
@@ -27,14 +43,14 @@ index deadfe2..be18286 100644
27
43
- --timeout=5 --tries=50 --no-verbose \
28
44
+ --timeout=5 --tries=150 --no-verbose \
29
45
--retry-connrefused --waitretry=10 --read-timeout=20 \
30
- - http ://en.cppreference.com/w/ ; \
46
+ - https ://en.cppreference.com/w/ ; \
31
47
+ https://zh.cppreference.com/w/ ; \
32
48
popd > /dev/null
33
49
34
50
- ./export.py --url=http://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
35
51
+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
36
52
diff --git a/commands/preprocess.py b/commands/preprocess.py
37
- index ed67174..aec036c 100644
53
+ index 7759951..3e485a2 100644
38
54
--- a/commands/preprocess.py
39
55
+++ b/commands/preprocess.py
40
56
@@ -40,15 +40,15 @@ def rearrange_archive(root):
@@ -75,7 +91,7 @@ index ed67174..aec036c 100644
75
91
76
92
# remove the XML source file
77
93
for fn in fnmatch.filter(os.listdir(root), 'cppreference-export*.xml'):
78
- @@ -214 ,7 +214 ,7 @@ def has_class(el, classes_to_check):
94
+ @@ -242 ,7 +242 ,7 @@ def has_class(el, classes_to_check):
79
95
return False
80
96
81
97
def preprocess_html_file(root, fn, rename_map):
@@ -84,7 +100,7 @@ index ed67174..aec036c 100644
84
100
html = etree.parse(fn, parser)
85
101
86
102
# remove non-printable elements
87
- @@ -236 ,7 +236 ,9 @@ def preprocess_html_file(root, fn, rename_map):
103
+ @@ -264 ,7 +264 ,9 @@ def preprocess_html_file(root, fn, rename_map):
88
104
for el in html.xpath('/html/body/script'):
89
105
if el.get('src') is not None and 'google-analytics.com/ga.js' in el.get('src'):
90
106
el.getparent().remove(el)
@@ -169,10 +185,10 @@ index cb6e8cc..a8ac18f 100755
169
185
rearrange_archive(root)
170
186
171
187
diff --git a/tests/test_preprocess.py b/tests/test_preprocess.py
172
- index e4aa687..4856f1b 100644
188
+ index d135048..ebce6f8 100644
173
189
--- a/tests/test_preprocess.py
174
190
+++ b/tests/test_preprocess.py
175
- @@ -6 ,23 +6 ,23 @@ from lxml import etree
191
+ @@ -24 ,23 +24 ,23 @@ from lxml import etree
176
192
177
193
class TestConvertLoaderName(unittest.TestCase):
178
194
def test_convert_loader_name(self):
@@ -201,3 +217,6 @@ index e4aa687..4856f1b 100644
201
217
modules=ext.gadget.ColiruCompiler%2CMathJax%7Cext.rtlcite%7Cmediawiki.\
202
218
legacy.commonPrint%2Cshared%7Cskins.cppreference2&only=styles&skin=\
203
219
cppreference2&*'
220
+ - -
221
+ 2.19.0
222
+
0 commit comments