Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aee9d6b

Browse files
committed
Allow recursive searh entries by ending the pathname in ":*".
1 parent cb9b1eb commit aee9d6b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Mac/Lib/mkcwproject/cwxmlgen.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,25 @@ def _generate_one_template(self, tmpl):
4747
if not type(keyvalues) in (type(()), type([])):
4848
raise Error, "List or tuple expected for %s"%key
4949
for curkeyvalue in keyvalues:
50-
self.dict[key] = curkeyvalue
5150
if os.path.isabs(curkeyvalue):
5251
self.dict['pathtype'] = 'Absolute'
5352
else:
5453
self.dict['pathtype'] = 'Project'
54+
if curkeyvalue[-2:] == ':*':
55+
curkeyvalue = curkeyvalue[:-2]
56+
self.dict['recursive'] = 'true'
57+
else:
58+
self.dict['recursive'] = 'false'
59+
self.dict[key] = curkeyvalue
5560
curkeyvalueresult = self._generate_one_value(datasource, dataname)
5661
result = result + curkeyvalueresult
5762
finally:
5863
# Restore the list
5964
self.dict[key] = keyvalues
6065
self.dict['pathtype'] = None
6166
del self.dict['pathtype']
67+
self.dict['recursive'] = None
68+
del self.dict['recursive']
6269
else:
6370
# Not a multi-element rule. Simply generate
6471
result = self._generate_one_value(datasource, dataname)

Mac/Lib/mkcwproject/template/template-searchdirs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
55
<SETTING><NAME>PathRoot</NAME><VALUE>%(pathtype)s</VALUE></SETTING>
66
</SETTING>
7-
<SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
7+
<SETTING><NAME>Recursive</NAME><VALUE>%(recursive)s</VALUE></SETTING>
88
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
99
</SETTING>

0 commit comments

Comments
 (0)