summaryrefslogtreecommitdiffstats
path: root/lasso/extract_types.py
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2005-11-20 15:38:19 +0000
committerFrederic Peters <fpeters@entrouvert.com>2005-11-20 15:38:19 +0000
commitebb9f7dffc22196e6c1cb18b218fc411b4d190c2 (patch)
treefce2aedd2eebee66103da6dc0f811063b8934f12 /lasso/extract_types.py
parent56c88d1921c3b05c0213d2a1321502b2290b0b6f (diff)
downloadlasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.tar.gz
lasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.tar.xz
lasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.zip
SAML 2.0 support (only web-sso for the moment)
Diffstat (limited to 'lasso/extract_types.py')
-rw-r--r--lasso/extract_types.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lasso/extract_types.py b/lasso/extract_types.py
index 83fab0c6..95419f62 100644
--- a/lasso/extract_types.py
+++ b/lasso/extract_types.py
@@ -1,8 +1,10 @@
#! /usr/bin/env python
+from cStringIO import StringIO
import glob
import re
import sys
+import os
enable_wsf = 0
@@ -21,7 +23,7 @@ wsf = ['lasso_disco_', 'lasso_dst_', 'lasso_is_', 'lasso_profile_service',
if enable_wsf:
wsf = []
-fd = open('types.c', 'w')
+fd = StringIO()
print >> fd, "/* This file has been autogenerated; changes will be lost */"
print >> fd, ""
@@ -29,7 +31,7 @@ print >> fd, "typedef GType (*type_function) (void);"
print >> fd, ""
header_files = []
-for header_file in glob.glob('%s/*/*.h' % srcdir):
+for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*/*/*.h' % srcdir):
if not enable_wsf and 'id-wsf' in header_file:
continue
header_files.append(header_file)
@@ -58,3 +60,5 @@ for header_file in header_files:
print >> fd, "\tNULL"
print >> fd, "};"
+if not os.path.exists('types.c') or fd.getvalue() != file('types.c').read():
+ file('types.c', 'w').write(fd.getvalue())