summaryrefslogtreecommitdiff
path: root/helpcontent2/wiki-to-help/mw.py
diff options
context:
space:
mode:
authorTimo Richter <timo@iera.de>2011-07-14 19:09:20 +0200
committerAndras Timar <atimar@suse.com>2011-07-14 19:09:20 +0200
commit3aabd79dd9dd86d125fa73052bcf3de642767b88 (patch)
treead22f1e5a04c6d083da87120b807765acdb2074d /helpcontent2/wiki-to-help/mw.py
parent791e6a841bf80a4c3843f093c392211c82118d9c (diff)
Usage of wine depends on platform
Mwlib is being run internally to make it faster
Diffstat (limited to 'helpcontent2/wiki-to-help/mw.py')
-rw-r--r--helpcontent2/wiki-to-help/mw.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/helpcontent2/wiki-to-help/mw.py b/helpcontent2/wiki-to-help/mw.py
new file mode 100644
index 0000000000..d2709cc6bc
--- /dev/null
+++ b/helpcontent2/wiki-to-help/mw.py
@@ -0,0 +1,26 @@
+import mwlib.cdbwiki, mwlib.apps.render, mwlib.apps
+import sys
+
+class MW(object):
+ """ This is the proxy class for mwlib """
+
+ @staticmethod
+ def _setArgs(function,args):
+ """ Set sys.argv for @function """
+ bak = sys.argv
+ args=("nothing",)+args
+ dec=[x.encode() for x in args]
+ sys.argv=dec
+ r=function()
+ sys.argv=bak
+ return r
+
+ @staticmethod
+ def buildcdb(source,dest):
+ args=("--input",source,"--output",dest)
+ return MW._setArgs(mwlib.apps.buildcdb,args)
+ #mwlib.cdbwiki.BuildWiki(*args)
+
+ @staticmethod
+ def render(*args):
+ return MW._setArgs(mwlib.apps.render.Main(),args)