3 import xml.etree.ElementTree
as ET
13 type = child.attrib[
'name']
14 if type ==
'prerequisites' :
15 tupleList = child[0].findall(
'tuple')
16 textList= [l.findall(
"text")
for l
in tupleList]
18 finalList.append(tl[0].text)
26 type = child.attrib[
'name']
27 if type ==
'suite_ids' or type==
'test_ids':
28 setList = child[0].findall(
'set')
29 textList = [l.findall(
'text')
for l
in tupleList]
31 finalList.append(tl[0].text)
36 newPath = os.path.normpath(os.path.expandvars(p))
37 if os.path.exists(newPath) :
38 p = os.path.realpath(newPath)
39 p = os.path.realpath(newPath)
43 def sniffer(dir,originDirectory='',package=''):
48 fileList = [ l
for l
in os.listdir(dir)
if not l.startswith(
'.')]
49 if dir.endswith(
".qms"):
50 t,p=os.path.split(dir)
53 if file.endswith(
".qmt"):
54 finalList[newPackage+os.path.basename(file)]=
QMTsniffer(file)
55 elif file.endswith(
".qms")
and os.path.isfile(file):
56 finalList[newPackage+os.path.basename(file)]=
QMSsniffer(file)
57 elif file.endswith(
".qms"):
59 newResult=
sniffer(file,dir,package=newPackage)
60 finalList=dict(finalList.items()+newResult.items())
61 finalList[newPackage+os.path.basename(file)]=[ ld
for ld
in os.listdir(file)
if (
not l.startswith(
'.')
and (l.endswith(
'.qmt')
or not l.endswith(
'.qms')))]
62 elif os.path.isdir(file):
64 newResult=
sniffer(file,dir,package=newPackage)
65 finalList=dict(finalList.items()+newResult.items())
66 if originDirectory!=
'' :
67 os.chdir(originDirectory)