[gobject-introspection/gir-docbook: 2/2] [docbook] fix exception when there is no ctype.



commit ee49a56ab6febafe075daeecddf2cc2b36dcf2e2
Author: Laszlo Pandy <lpandy src gnome org>
Date:   Thu Aug 11 10:21:41 2011 +0200

    [docbook] fix exception when there is no ctype.

 giscanner/docbookwriter.py |    6 +++++-
 giscanner/docmain.py       |    5 ++---
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/docbookwriter.py b/giscanner/docbookwriter.py
index 2ff8cdf..2056c42 100644
--- a/giscanner/docbookwriter.py
+++ b/giscanner/docbookwriter.py
@@ -86,7 +86,11 @@ class DocBookFormatter(object):
         self._writer.disable_whitespace()
 
         retval_type = method.retval.type
-        link_dest = retval_type.ctype.replace("*", "")
+        if retval_type.ctype:
+            link_dest = retval_type.ctype.replace("*", "")
+        else:
+            link_dest = str(retval_type)
+
         if retval_type.target_giname:
             ns = retval_type.target_giname.split('.')
             if ns[0] == self._namespace.name:
diff --git a/giscanner/docmain.py b/giscanner/docmain.py
index 8e54d7a..7684944 100644
--- a/giscanner/docmain.py
+++ b/giscanner/docmain.py
@@ -34,9 +34,8 @@ class GIDocGenerator(object):
         writer.add_namespace(ns)
         writer.write(output)
 
-
 def doc_main(args):
-    parser = optparse.OptionParser('%prog [options] sources')
+    parser = optparse.OptionParser('%prog [options] GIR-file')
 
     parser.add_option("-o", "--output",
                       action="store", dest="output",
@@ -51,7 +50,7 @@ def doc_main(args):
         raise SystemExit("missing output parameter")
 
     if len(args) < 2:
-        raise SystemExit("Need an input gir filename")
+        raise SystemExit("Need an input GIR filename")
 
     if options.format == "docbook":
         writer = DocBookWriter()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]