summaryrefslogtreecommitdiff
path: root/app/misc/genFAQ.py
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-01-12 19:18:54 +0100
committerParménides GV <parmegv@sdf.org>2015-01-12 19:18:54 +0100
commit32998b046977da5d272a948ad0668bf653d598f4 (patch)
treea8f68d5b09d7293ceb35211d2f26f48d4312fcf3 /app/misc/genFAQ.py
parent1d37f94a7980d1181a49863cb3880bc7938cc6d1 (diff)
parent6ed3fde3ea171700390552dd1040e10e8cc1ca32 (diff)
Merge branch 'bug/Release-ConfigurationWizard-differs-from-debug's-#6633' into bug/ButterKnife-doesn't-find-provider_list_view-#6581
Diffstat (limited to 'app/misc/genFAQ.py')
-rwxr-xr-xapp/misc/genFAQ.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/app/misc/genFAQ.py b/app/misc/genFAQ.py
index 09381caa..9a0c9af5 100755
--- a/app/misc/genFAQ.py
+++ b/app/misc/genFAQ.py
@@ -4,6 +4,7 @@
import codecs
import xml.dom.minidom as dom
import os.path
+import re
faqpath = "/Users/arne/oss/ics-openvpn.wiki"
@@ -29,7 +30,22 @@ def getString(strid,lang):
ostr = ostr.replace("\\n","<p>")
return ostr
-def genPage(faqdom,lang):
+def genPage(javafile, lang):
+ #{R.string.faq_howto_title, R.string.faq_howto},
+ out =""
+ out+= header
+ for l in javafile:
+ m = re.search("\{.*R.string.([a-z_]+),.*R.string.([a-z_]+)\}", l)
+ if m:
+ (title, body) = m.groups()
+
+ out += "== %s ==\n" % getString(title,lang)
+ out += "%s\n" % getString(body,lang)
+ if body == "faq_system_dialogs_title":
+ out += "%s\n" % getString("faq_system_dialog_xposed",lang)
+ return out
+
+def genPageXML(faqdom,lang):
out =""
#out+="#summary %s\n" % getString("faq_summary",lang)
@@ -75,13 +91,14 @@ def main():
loadstrres("src/main/res/values/strings.xml","default")
- faqdom = dom.parse("src/main/res/layout/faq.xml")
+ #faqdom = dom.parse("src/main/res/layout/faq.xml")
+ faqdom = open("src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java").readlines()
faq= genPage(faqdom,"default")
open(faqpath + "/FAQ.wiki","w").write(faq)
for directory in os.listdir("src/main/res"):
- if directory.startswith("values-") and directory.find("-sw")==-1:
+ if directory.startswith("values-") and directory.find("-sw")==-1 and not directory.startswith("values-v"):
lang = directory.split("-",1)[1]
print lang
loadstrres("src/main/res/values-%s/strings.xml" % lang,lang)