mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Allow recursive searh entries by ending the pathname in ":*".
This commit is contained in:
parent
cb9b1ebe6c
commit
aee9d6b73e
2 changed files with 9 additions and 2 deletions
|
|
@ -47,11 +47,16 @@ def _generate_one_template(self, tmpl):
|
|||
if not type(keyvalues) in (type(()), type([])):
|
||||
raise Error, "List or tuple expected for %s"%key
|
||||
for curkeyvalue in keyvalues:
|
||||
self.dict[key] = curkeyvalue
|
||||
if os.path.isabs(curkeyvalue):
|
||||
self.dict['pathtype'] = 'Absolute'
|
||||
else:
|
||||
self.dict['pathtype'] = 'Project'
|
||||
if curkeyvalue[-2:] == ':*':
|
||||
curkeyvalue = curkeyvalue[:-2]
|
||||
self.dict['recursive'] = 'true'
|
||||
else:
|
||||
self.dict['recursive'] = 'false'
|
||||
self.dict[key] = curkeyvalue
|
||||
curkeyvalueresult = self._generate_one_value(datasource, dataname)
|
||||
result = result + curkeyvalueresult
|
||||
finally:
|
||||
|
|
@ -59,6 +64,8 @@ def _generate_one_template(self, tmpl):
|
|||
self.dict[key] = keyvalues
|
||||
self.dict['pathtype'] = None
|
||||
del self.dict['pathtype']
|
||||
self.dict['recursive'] = None
|
||||
del self.dict['recursive']
|
||||
else:
|
||||
# Not a multi-element rule. Simply generate
|
||||
result = self._generate_one_value(datasource, dataname)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>%(pathtype)s</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>%(recursive)s</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue