diff options
Diffstat (limited to 'helpcontent2/wiki-to-help/mw.py')
-rw-r--r-- | helpcontent2/wiki-to-help/mw.py | 26 |
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) |