summaryrefslogtreecommitdiff
path: root/giscanner/docmain.py
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2011-08-14 10:16:35 -0400
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2011-08-15 11:36:49 +0200
commitb15fed060983183cb59f73beb1e72dbc4e16349f (patch)
tree02b4b28f81629eab985f9d51a0c613c53120752a /giscanner/docmain.py
parent7c41284516463f314b6f7ba801cb255f9742858d (diff)
downloadgobject-introspection-b15fed060983183cb59f73beb1e72dbc4e16349f.tar.gz
giscanner/mallardwriter: Adding experimental Mallard output to g-ir-doc-tool
Diffstat (limited to 'giscanner/docmain.py')
-rw-r--r--giscanner/docmain.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/giscanner/docmain.py b/giscanner/docmain.py
index 3bffaefe..9bca4c85 100644
--- a/giscanner/docmain.py
+++ b/giscanner/docmain.py
@@ -23,6 +23,9 @@ import optparse
from .docbookwriter import DocBookWriter
from .docbookwriter import DocBookFormatterC
from .docbookwriter import DocBookFormatterPython
+from .mallardwriter import MallardWriter
+from .mallardwriter import MallardFormatterC
+from .mallardwriter import MallardFormatterPython
from .transformer import Transformer
class GIDocGenerator(object):
@@ -56,15 +59,22 @@ def doc_main(args):
if len(args) < 2:
raise SystemExit("Need an input GIR filename")
- if options.language == "Python":
- formatter = DocBookFormatterPython()
- elif options.language == "C":
- formatter = DocBookFormatterC()
- else:
- raise SystemExit("Unsupported language: %s" % (options.language, ))
-
if options.format == "docbook":
+ if options.language == "Python":
+ formatter = DocBookFormatterPython()
+ elif options.language == "C":
+ formatter = DocBookFormatterC()
+ else:
+ raise SystemExit("Unsupported language: %s" % (options.language, ))
writer = DocBookWriter(formatter)
+ elif options.format == "mallard":
+ if options.language == "Python":
+ formatter = MallardFormatterPython()
+ elif options.language == "C":
+ formatter = MallardFormatterC()
+ else:
+ raise SystemExit("Unsupported language: %s" % (options.language, ))
+ writer = MallardWriter(formatter)
else:
raise SystemExit("Unsupported output format: %s" % (options.format, ))