Add license header to Python files.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2177 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
bbahnsen
2007-01-05 21:08:32 +00:00
parent fc7599b9aa
commit 3b7a53b683
6 changed files with 76 additions and 9 deletions

View File

@ -1,7 +1,16 @@
#!/usr/bin/env python
# This is an XML API that uses a syntax similar to XPath, but it is written in
# standard python so that no extra python packages are required to use it.
# Copyright (c) 2007, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
"""This is an XML API that uses a syntax similar to XPath, but it is written in
standard python so that no extra python packages are required to use it."""
import xml.dom.minidom
@ -35,10 +44,10 @@ def XmlElementData (Dom):
"""Get the text for this element."""
return Dom.firstChild.data.strip()
def XmlAttribute (Dom, String):
"""Return a single attribute that named by String."""
def XmlAttribute (Dom, AttName):
"""Return a single attribute named AttName."""
try:
return Dom.getAttribute(String)
return Dom.getAttribute(AttName)
except:
return ''