summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-01-19 15:45:13 +0100
committerJan Holesovsky <kendy@suse.cz>2011-01-19 15:45:13 +0100
commit2c4a94f2126d24662d7089d8ab754691c7a842f9 (patch)
tree8b2a3ac3ae62d67c4a39e72651c0dfda80becb58
parentd20259aa9e106d0e9a9347efefd4be7972f194b0 (diff)
wikihelp: Generate the images and redirects only once.
-rwxr-xr-xhelpcontent2/to-wiki/wikiconv2.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py
index 2b3dd5df51..5d0b7af57c 100755
--- a/helpcontent2/to-wiki/wikiconv2.py
+++ b/helpcontent2/to-wiki/wikiconv2.py
@@ -1253,9 +1253,15 @@ def write_redirects():
# Main Function
def convert(generate_redirects, lang, sdf_file):
if lang == '':
- print 'Generating the wiki main pages...'
+ print 'Generating the main wiki pages...'
else:
print 'Generating the wiki pages for language %s...'% lang
+
+ global redirects
+ redirects = []
+ global images
+ images = set()
+
load_hid_lst()
loadallfiles("alltitles.csv")
@@ -1300,15 +1306,16 @@ def convert(generate_redirects, lang, sdf_file):
while threading.active_count() > 1:
time.sleep(0.001)
- # set of the images used here
- print 'Generating "images.txt", the list of used images...'
- file = open('images.txt', "w")
- for image in images:
- file.write('%s\n'% image)
- file.close()
+ if lang == '':
+ # set of the images used here
+ print 'Generating "images.txt", the list of used images...'
+ file = open('images.txt', "w")
+ for image in images:
+ file.write('%s\n'% image)
+ file.close()
- # generate the redirects
- if generate_redirects:
- write_redirects()
+ # generate the redirects
+ if generate_redirects:
+ write_redirects()
# vim:set shiftwidth=4 softtabstop=4 expandtab: