Permalink
Browse files

giscanner/mallardwriter: Adding experimental Mallard output to g-ir-d…

…oc-tool
  • Loading branch information...
shaunix authored and tomeuv committed Aug 14, 2011
1 parent 7c41284 commit b15fed060983183cb59f73beb1e72dbc4e16349f
Showing with 495 additions and 8 deletions.
  1. +1 −0 Makefile-giscanner.am
  2. +17 −7 giscanner/docmain.py
  3. +476 −0 giscanner/mallardwriter.py
  4. +1 −1 giscanner/xmlwriter.py
View
@@ -42,6 +42,7 @@ pkgpyexec_PYTHON = \
giscanner/gdumpparser.py \
giscanner/libtoolimporter.py \
giscanner/odict.py \
+ giscanner/mallardwriter.py \
giscanner/maintransformer.py \
giscanner/message.py \
giscanner/shlibs.py \
View
@@ -23,6 +23,9 @@
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, ))
Oops, something went wrong.

0 comments on commit b15fed0

Please sign in to comment.