分析packages.xml,显示primaryCpuAbi。
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from xml.dom.minidom import parse
import xml.dom.minidom
DOMTree = xml.dom.minidom.parse("packages.xml")
collection = DOMTree.documentElement
packages = collection.getElementsByTagName("package")
print "primaryCpuAbi sharedUserId name codePath"
for package in packages:
if package.getAttribute("sharedUserId") != '1000' :
continue
if package.hasAttribute("primaryCpuAbi") and package.hasAttribute("sharedUserId") and package.hasAttribute("name") and package.hasAttribute("codePath"):
'''print "%16s %s %s %s" % (package.getAttribute("primaryCpuAbi"), package.getAttribute("sharedUserId"), package.getAttribute("name"), package.getAttribute("codePath"))'''
print "%-40s %-40s %s %s" % (package.getAttr