[gobject-introspection] docwriter: Don't render constants for now
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] docwriter: Don't render constants for now
- Date: Fri, 15 Feb 2013 11:45:46 +0000 (UTC)
commit c53e5f29befc6b9e8d71746caf79e53821a4db4f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Feb 15 05:45:27 2013 -0500
docwriter: Don't render constants for now
Clutter has thousands of keysym constants, and until we get them
all on one page, this is just tons of tiny files that are just
noise.
giscanner/docwriter.py | 5 +++-
.../Regress.ANNOTATION_CALCULATED_DEFINE.page | 25 -------------------
.../Regress.ANNOTATION_CALCULATED_LARGE.page | 26 --------------------
.../Regress.ANNOTATION_CALCULATED_LARGE_DIV.page | 25 -------------------
.../Regress.DOUBLE_CONSTANT.page | 25 -------------------
.../Regress.FOO_DEFINE_SHOULD_BE_EXPOSED.page | 25 -------------------
.../Regress.FOO_PIE_IS_TASTY.page | 25 -------------------
.../Regress.FOO_SUCCESS_INT.page | 25 -------------------
.../Regress.GUINT64_CONSTANT.page | 25 -------------------
.../Regress.GUINT64_CONSTANTA.page | 25 -------------------
.../Regress.G_GINT64_CONSTANT.page | 25 -------------------
.../Regress.INT_CONSTANT.page | 25 -------------------
.../Regress.LONG_STRING_CONSTANT.page | 25 -------------------
.../Regress-1.0-C-expected/Regress.MAXUINT64.page | 25 -------------------
.../Regress-1.0-C-expected/Regress.MININT64.page | 25 -------------------
.../Regress.Mixed_Case_Constant.page | 25 -------------------
.../Regress.NEGATIVE_INT_CONSTANT.page | 25 -------------------
.../Regress.STRING_CONSTANT.page | 25 -------------------
.../Regress.UTF8_CONSTANT.page | 25 -------------------
.../Regress.ANNOTATION_CALCULATED_DEFINE.page | 25 -------------------
.../Regress.ANNOTATION_CALCULATED_LARGE.page | 26 --------------------
.../Regress.ANNOTATION_CALCULATED_LARGE_DIV.page | 25 -------------------
.../Regress.DOUBLE_CONSTANT.page | 25 -------------------
.../Regress.FOO_DEFINE_SHOULD_BE_EXPOSED.page | 25 -------------------
.../Regress.FOO_PIE_IS_TASTY.page | 25 -------------------
.../Regress.FOO_SUCCESS_INT.page | 25 -------------------
.../Regress.GUINT64_CONSTANT.page | 25 -------------------
.../Regress.GUINT64_CONSTANTA.page | 25 -------------------
.../Regress.G_GINT64_CONSTANT.page | 25 -------------------
.../Regress.INT_CONSTANT.page | 25 -------------------
.../Regress.LONG_STRING_CONSTANT.page | 25 -------------------
.../Regress.MAXUINT64.page | 25 -------------------
.../Regress-1.0-Gjs-expected/Regress.MININT64.page | 25 -------------------
.../Regress.Mixed_Case_Constant.page | 25 -------------------
.../Regress.NEGATIVE_INT_CONSTANT.page | 25 -------------------
.../Regress.STRING_CONSTANT.page | 25 -------------------
.../Regress.UTF8_CONSTANT.page | 25 -------------------
.../Regress.ANNOTATION_CALCULATED_DEFINE.page | 25 -------------------
.../Regress.ANNOTATION_CALCULATED_LARGE.page | 26 --------------------
.../Regress.ANNOTATION_CALCULATED_LARGE_DIV.page | 25 -------------------
.../Regress.DOUBLE_CONSTANT.page | 25 -------------------
.../Regress.FOO_DEFINE_SHOULD_BE_EXPOSED.page | 25 -------------------
.../Regress.FOO_PIE_IS_TASTY.page | 25 -------------------
.../Regress.FOO_SUCCESS_INT.page | 25 -------------------
.../Regress.GUINT64_CONSTANT.page | 25 -------------------
.../Regress.GUINT64_CONSTANTA.page | 25 -------------------
.../Regress.G_GINT64_CONSTANT.page | 25 -------------------
.../Regress.INT_CONSTANT.page | 25 -------------------
.../Regress.LONG_STRING_CONSTANT.page | 25 -------------------
.../Regress.MAXUINT64.page | 25 -------------------
.../Regress.MININT64.page | 25 -------------------
.../Regress.Mixed_Case_Constant.page | 25 -------------------
.../Regress.NEGATIVE_INT_CONSTANT.page | 25 -------------------
.../Regress.STRING_CONSTANT.page | 25 -------------------
.../Regress.UTF8_CONSTANT.page | 25 -------------------
55 files changed, 4 insertions(+), 1354 deletions(-)
---
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index bf0ca20..85f3b16 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -170,6 +170,9 @@ class DocFormatter(object):
return saxutils.escape(text)
def should_render_node(self, node):
+ if isinstance(node, ast.Constant):
+ return False
+
return True
def format(self, node, doc):
@@ -394,7 +397,7 @@ class DocFormatterIntrospectableBase(DocFormatter):
if not getattr(node, "introspectable", True):
return False
- return True
+ return super(DocFormatterIntrospectableBase, self).should_render_node(node)
class DocFormatterPython(DocFormatterIntrospectableBase):
language = "Python"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]