diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-01-17 19:18:59 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-01-17 19:18:59 +0100 |
commit | 7e5c805ecda3967bb251305f0da78f005254511e (patch) | |
tree | be884e320c3cfc68ee29733994a78e6ab64badfb | |
parent | 33b8a59561c43b16af55460f3e300effb59869d0 (diff) |
wikihelp: Return with an error when we do not get an existing .sdf.
-rwxr-xr-x | helpcontent2/to-wiki/wikiconv2.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py index 87d0d45770..719ea120c4 100755 --- a/helpcontent2/to-wiki/wikiconv2.py +++ b/helpcontent2/to-wiki/wikiconv2.py @@ -182,8 +182,10 @@ def load_localization_data(sdf_file): continue localization_data.append(line.split("\t")) file.close() + return True except: - return + sys.stderr.write('Error: Cannot open .sdf file "%s"\n'% sdf_file) + return False def replace_gt_lt(str,char,replace): # Add additional space to catch strings starting with <= @@ -1269,8 +1271,10 @@ def convert(generate_redirects, localizations): load_hid_lst() loadallfiles("alltitles.csv") - if len(localizations) > 1: - load_localization_data(localizations[1]) + if len(localizations) > 0: + sys.stderr.write('Using localizations from "%s"\n'% localizations[0]) + if not load_localization_data(localizations[0]): + return for title in titles: while threading.active_count() > max_threads: |