Feb-17-2019, 09:48 AM
Since I have not received any response. I tried in the below way. The code looks good to me but it is running into infinite loop in the for loop is for repo_temp in rps_temp: so the function call running into infinite loop. where I am making mistake in the below code.
path="/home/" url = "<url>" nme = {'xmlns' : url} def find( repo, dep ): pom=path+repo+"/pom.xml" if not os.path.exists(pom): return tree = ElementTree.parse(pom) root = tree.getroot() deps = root.findall(".//xmlns:dependent", nme=nme) for d in deps: aid = d.find("xmlns:aid", nme=nme) vsn = d.find("xmlns:vsn", nme=nme) if dep == aid.text: print repo + " : " + vsn.text rps_temp=os.walk(path).next()[1] temp = repo for repo_temp in rps_temp: dep_check(repo_temp, temp) return print "\ndependecy:\n" rps=os.walk(path).next()[1] for repo in rps: find(repo, dep) print "\n"