summaryrefslogtreecommitdiff
path: root/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py
diff options
context:
space:
mode:
authorDaryl McDaniel <edk2-lists@mc2research.org>2015-12-23 00:15:45 +0000
committerdarylm503 <darylm503@Edk2>2015-12-23 00:15:45 +0000
commitd11973f1cae1d8e25017b09734fbf419342b192a (patch)
treefcbb2f3bcee995a798858ca00fab3c07b5499a45 /AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py
parent5285ac3eba73d3f6ad8cf356a0a8815fe97b3cf3 (diff)
downloadedk2-platforms-d11973f1cae1d8e25017b09734fbf419342b192a.tar.xz
AppPkg/.../Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10
Apply UEFI-specific changes to files to make them equivalent to the Python 2.7.2 versions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> --- AppPkg/AppPkg.dsc | 5 +- .../Python/Python-2.7.10/Ia32/pyconfig.h | 93 ++++++++---- .../Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py | 30 +++- .../Python/Python-2.7.10/PyMod-2.7.10/Lib/os.py | 35 ++++- .../Python/Python-2.7.10/PyMod-2.7.10/Lib/pydoc.py | 17 +++ .../Python/Python-2.7.10/PyMod-2.7.10/Lib/site.py | 165 ++++++--------------- .../Python-2.7.10/PyMod-2.7.10/Modules/_sre.c | 150 ++++++++++--------- .../Python-2.7.10/PyMod-2.7.10/Modules/addrinfo.h | 101 +++++++------ .../PyMod-2.7.10/Modules/errnomodule.c | 57 ++++++- .../PyMod-2.7.10/Modules/expat/expat_external.h | 4 +- .../Python-2.7.10/PyMod-2.7.10/Modules/getpath.c | 143 +++++------------- .../Python-2.7.10/PyMod-2.7.10/Modules/main.c | 61 ++++---- .../PyMod-2.7.10/Modules/selectmodule.c | 43 ++++-- .../PyMod-2.7.10/Modules/zlib/gzguts.h | 10 +- .../PyMod-2.7.10/Modules/zlib/zutil.h | 11 +- .../PyMod-2.7.10/Objects/longobject.c | 14 +- .../PyMod-2.7.10/Objects/stringlib/localeutil.h | 17 ++- .../PyMod-2.7.10/Python/getcopyright.c | 24 ++- .../Python-2.7.10/PyMod-2.7.10/Python/marshal.c | 21 ++- .../Python-2.7.10/PyMod-2.7.10/Python/random.c | 32 +++- .../Python/Python-2.7.10/X64/pyconfig.h | 63 ++++++-- 21 files changed, 640 insertions(+), 456 deletions(-) git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19462 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py')
-rw-r--r--AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py
index ac89e2c9fe..ab10a28ac8 100644
--- a/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py
+++ b/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py
@@ -1,5 +1,18 @@
-# Module 'ntpath' -- common operations on WinNT/Win95 pathnames
-"""Common pathname manipulations, WindowsNT/95 version.
+
+# Module 'ntpath' -- common operations on WinNT/Win95 and UEFI pathnames.
+#
+# Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
+# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+# This program and the accompanying materials are licensed and made available under
+# the terms and conditions of the BSD License that accompanies this distribution.
+# The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+
+"""Common pathname manipulations, WindowsNT/95 and UEFI version.
Instead of importing this module directly, import os and refer to this
module as os.path.
@@ -93,6 +106,9 @@ def join(path, *paths):
# Split a path in a drive specification (a drive letter followed by a
# colon) and the path specification.
# It is always true that drivespec + pathspec == p
+# NOTE: for UEFI (and even Windows) you can have multiple characters to the left
+# of the ':' for the device or drive spec. This is reflected in the modifications
+# to splitdrive() and splitunc().
def splitdrive(p):
"""Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty.
@@ -130,8 +146,10 @@ def splitdrive(p):
if index2 == -1:
index2 = len(p)
return p[:index2], p[index2:]
- if normp[1] == ':':
- return p[:2], p[2:]
+ index = p.find(':')
+ if index != -1:
+ index = index + 1
+ return p[:index], p[index:]
return '', p
# Parse UNC paths
@@ -143,8 +161,8 @@ def splitunc(p):
using backslashes). unc+rest is always the input path.
Paths containing drive letters never have an UNC part.
"""
- if p[1:2] == ':':
- return '', p # Drive letter present
+ if ':' in p:
+ return '', p # Drive letter or device name present
firstTwo = p[0:2]
if firstTwo == '//' or firstTwo == '\\\\':
# is a UNC path: