diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-10-18 17:35:55 +0200 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-10-18 17:35:55 +0200 |
commit | 3c6970e0471bb8cc9f0dfc124427119d1d48db2e (patch) | |
tree | bd7ca42c6a4c0871df9b6e23402308661a7efb16 | |
parent | 4552f3029350cc4fd4d618a65e98d02ac4f312c0 (diff) | |
download | lasso-3c6970e0471bb8cc9f0dfc124427119d1d48db2e.tar.gz lasso-3c6970e0471bb8cc9f0dfc124427119d1d48db2e.tar.xz lasso-3c6970e0471bb8cc9f0dfc124427119d1d48db2e.zip |
[bindings] fix tree traversal on windows
- The file path separator is not / on all platforms, so do not use it
when matching filenames.
-rw-r--r-- | bindings/bindings.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bindings/bindings.py b/bindings/bindings.py index 1f8c6dc3..dc18ff4a 100644 --- a/bindings/bindings.py +++ b/bindings/bindings.py @@ -153,7 +153,8 @@ class BindingData: return funcs[0] regex = re.compile(r'\/\*\*\s(.*?)\*\/', re.DOTALL) for base, dirnames, filenames in os.walk(srcdir): - if base.endswith('/.svn'): + bname = os.path.basename(base) + if bname == '.svn': # ignore svn directories continue if not 'Makefile.am' in filenames: @@ -561,14 +562,15 @@ def parse_headers(srcdir): if not binding.options.idwsf: exclusion += ( 'idwsf_strings.h', ) for base, dirnames, filenames in os.walk(srcdir): - if base.endswith('/.svn'): + bname = os.path.basename(base) + if bname == '.svn': # ignore svn directories continue if not 'Makefile.am' in filenames: # not a source dir continue - if not binding.options.idwsf and (base.endswith('/id-wsf') or \ - base.endswith('/id-wsf-2.0') or base.endswith('/ws')): + if not binding.options.idwsf and bname == 'id-wsf' or \ + bname == 'id-wsf-2.0' or bname == 'ws': # ignore ID-WSF continue makefile_am = open(os.path.join(base, 'Makefile.am')).read() |