On 11/08/2015 11:07 AM, Michał Górny wrote:
>>
>> <project>
>> <name>Foo</name>
>> <email>[email protected]</email>
>> <subproject ref="[email protected]"/>
>> </project>
>
> I meant finding project by e-mail. You don't have to care about
> subprojects at all to do this. Subprojects are a side info.
>
What exactly gets harder? Finding an email address is same in emacs/grep
regardless of the nesting. If you wanted to write a script, it might get
one line longer:
#!/usr/bin/python
import sys
import xml.etree.ElementTree as ET
tree = ET.parse('metadata.xml')
for project in tree.findall('.//project'):
if project.find('email').text == sys.argv[1]:
print(project.find('name').text)