[gobject-introspection] update-glib-annotations.py: new script



commit c8c23d2db2ec6594b5c43bd01cc78db396c709f3
Author: Colin Walters <walters verbum org>
Date:   Tue Jun 7 18:04:37 2011 -0400

    update-glib-annotations.py: new script

 misc/update-glib-annotations.py |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/misc/update-glib-annotations.py b/misc/update-glib-annotations.py
new file mode 100755
index 0000000..63d83fa
--- /dev/null
+++ b/misc/update-glib-annotations.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+if __name__ == '__main__':
+    srcdir = sys.argv[1]
+    sources = []
+    projname = 'glib'
+    subdir = os.path.join(srcdir, projname)
+    headersfile = os.path.join(subdir, projname + '-public-headers.txt')
+    f = open(headersfile)
+    line = f.read()
+    f.close()
+    for headername in line.split(' '):
+        headername = headername.strip()
+        if headername == 'gi18n-lib.h':
+            continue
+        sources.append(os.path.join(subdir, headername))
+    for sourcename in os.listdir(subdir):
+        if sourcename.endswith('.c'):
+            sources.append(os.path.join(subdir, sourcename))
+    os.execv('./g-ir-annotation-tool',
+             ['./g-ir-annotation-tool', '--extract',
+              '-DGLIB_COMPILATION',
+              '-I' + srcdir,
+              '-I' + os.path.join(srcdir, 'glib'),
+              '-I' + os.path.join(srcdir, 'gmodule')] + sources)



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