Import BaseMemoryLibMmx;
[mirror_edk2.git] / Tools / Python / ListWorkspace.py
1 #!/usr/bin/env python
2
3 """List the contents of the Framework Database to the screen in a readble
4 form."""
5
6 import os, sys, getopt, string, xml.dom.minidom, zipfile, md5
7 from XmlRoutines import *
8 from WorkspaceRoutines import *
9
10 def openDatabase(f):
11
12 print "Dumping the contents of %s workspace database file." % f
13
14 db = xml.dom.minidom.parse(inWorkspace(f))
15
16 return db
17
18 def showSpds(db):
19
20 print "--------\nPackages\n--------"
21
22 for spdFile in XmlList(db, "/FrameworkDatabase/PackageList/Filename"):
23 spdFileName = XmlElementData(spdFile)
24 spd = xml.dom.minidom.parse(inWorkspace(spdFileName))
25 spdName = XmlElement(spd, "/PackageSurfaceArea/SpdHeader/PackageName")
26
27 print " %-24s %-10s" % (spdName, spdFileName)
28
29 def showFpds(db):
30
31 print "--------\nPlatforms\n--------"
32
33 for fpdFile in XmlList(db, "/FrameworkDatabase/PlatformList/Filename"):
34 fpdFileName = XmlElementData(fpdFile)
35 fpd = xml.dom.minidom.parse(inWorkspace(fpdFileName))
36 fpdName = XmlElement(fpd, "/PlatformSurfaceArea/PlatformHeader/PlatformName")
37
38 print " %-24s %-10s" % (fpdName, fpdFileName)
39
40 # This acts like the main() function for the script, unless it is 'import'ed
41 # into another script.
42 if __name__ == '__main__':
43
44 db = openDatabase("Tools/Conf/FrameworkDatabase.db")
45
46 showSpds(db)
47 showFpds(db)