Skip to content

Commit f4ecdb4

Browse files
authored
1 parent 318cd24 commit f4ecdb4

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

zh.diff

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
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+
117
diff --git a/Makefile b/Makefile
2-
index deadfe2..be18286 100644
18+
index 9381549..6546a54 100644
319
--- a/Makefile
420
+++ b/Makefile
5-
@@ -230,7 +230,7 @@ indexes:
21+
@@ -237,7 +237,7 @@ indexes:
622
./index2autolinker.py index-functions-c.xml output/indexes/autolink-c
723
./index2autolinker.py index-functions-cpp.xml output/indexes/autolink-cpp
824

@@ -11,7 +27,7 @@ index deadfe2..be18286 100644
1127
source:
1228
rm -rf "reference"
1329
mkdir "reference"
14-
@@ -239,15 +239,15 @@ source:
30+
@@ -246,15 +246,15 @@ source:
1531
regex=".*index\\.php.*|.*/Special:.*|.*/Talk:.*" \
1632
regex+="|.*/Help:.*|.*/File:.*|.*/Cppreference:.*" \
1733
regex+="|.*/WhatLinksHere:.*|.*/Template:.*|.*/Category:.*" \
@@ -27,14 +43,14 @@ index deadfe2..be18286 100644
2743
- --timeout=5 --tries=50 --no-verbose \
2844
+ --timeout=5 --tries=150 --no-verbose \
2945
--retry-connrefused --waitretry=10 --read-timeout=20 \
30-
- http://en.cppreference.com/w/ ; \
46+
- https://en.cppreference.com/w/ ; \
3147
+ https://zh.cppreference.com/w/ ; \
3248
popd > /dev/null
3349

3450
- ./export.py --url=http://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
3551
+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
3652
diff --git a/commands/preprocess.py b/commands/preprocess.py
37-
index ed67174..aec036c 100644
53+
index 7759951..3e485a2 100644
3854
--- a/commands/preprocess.py
3955
+++ b/commands/preprocess.py
4056
@@ -40,15 +40,15 @@ def rearrange_archive(root):
@@ -75,7 +91,7 @@ index ed67174..aec036c 100644
7591

7692
# remove the XML source file
7793
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):
7995
return False
8096

8197
def preprocess_html_file(root, fn, rename_map):
@@ -84,7 +100,7 @@ index ed67174..aec036c 100644
84100
html = etree.parse(fn, parser)
85101

86102
# 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):
88104
for el in html.xpath('/html/body/script'):
89105
if el.get('src') is not None and 'google-analytics.com/ga.js' in el.get('src'):
90106
el.getparent().remove(el)
@@ -169,10 +185,10 @@ index cb6e8cc..a8ac18f 100755
169185
rearrange_archive(root)
170186

171187
diff --git a/tests/test_preprocess.py b/tests/test_preprocess.py
172-
index e4aa687..4856f1b 100644
188+
index d135048..ebce6f8 100644
173189
--- a/tests/test_preprocess.py
174190
+++ b/tests/test_preprocess.py
175-
@@ -6,23 +6,23 @@ from lxml import etree
191+
@@ -24,23 +24,23 @@ from lxml import etree
176192

177193
class TestConvertLoaderName(unittest.TestCase):
178194
def test_convert_loader_name(self):
@@ -201,3 +217,6 @@ index e4aa687..4856f1b 100644
201217
modules=ext.gadget.ColiruCompiler%2CMathJax%7Cext.rtlcite%7Cmediawiki.\
202218
legacy.commonPrint%2Cshared%7Cskins.cppreference2&only=styles&skin=\
203219
cppreference2&*'
220+
--
221+
2.19.0
222+

0 commit comments

Comments
 (0)