]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Library/Misc.py
BaseTools/UPT: Update the import statement to use StringUtils
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Library / Misc.py
index df9db2439b03b6806426bb98f896ae526a7f25e6..e16d309ef8838a52bb43ad061f96263976c968dd 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Common routines used by all tools\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -45,12 +45,12 @@ from Library.DataType import TAB_LANGUAGE_EN_US
 from Library.DataType import TAB_LANGUAGE_EN\r
 from Library.DataType import TAB_LANGUAGE_EN_X\r
 from Library.DataType import TAB_UNI_FILE_SUFFIXS\r
-from Library.String import GetSplitValueList\r
+from Library.StringUtils import GetSplitValueList\r
 from Library.ParserValidate import IsValidHexVersion\r
 from Library.ParserValidate import IsValidPath\r
 from Object.POM.CommonObject import TextObject\r
 from Core.FileHook import __FileHookOpen__\r
-from CommonDataClass.CommonClass import MultipleWorkspace as mws\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 \r
 ## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C \r
 # structure style\r
@@ -120,7 +120,7 @@ def GuidStructureStringToGuidString(GuidValue):
 # @param      Directory:   The directory name\r
 #\r
 def CreateDirectory(Directory):\r
-    if Directory == None or Directory.strip() == "":\r
+    if Directory is None or Directory.strip() == "":\r
         return True\r
     try:\r
         if not access(Directory, F_OK):\r
@@ -134,7 +134,7 @@ def CreateDirectory(Directory):
 # @param      Directory:   The directory name\r
 #\r
 def RemoveDirectory(Directory, Recursively=False):\r
-    if Directory == None or Directory.strip() == "" or not \\r
+    if Directory is None or Directory.strip() == "" or not \\r
     os.path.exists(Directory):\r
         return\r
     if Recursively:\r
@@ -237,7 +237,7 @@ def GetNonMetaDataFiles(Root, SkipList, FullPath, PrefixPath):
 #\r
 def ValidFile(File, Ext=None):\r
     File = File.replace('\\', '/')\r
-    if Ext != None:\r
+    if Ext is not None:\r
         FileExt = os.path.splitext(File)[1]\r
         if FileExt.lower() != Ext.lower():\r
             return False\r
@@ -423,7 +423,7 @@ class Sdict(IterableUserDict):
     ## update method\r
     #\r
     def update(self, Dict=None, **Kwargs):\r
-        if Dict != None:\r
+        if Dict is not None:\r
             for Key1, Val1 in Dict.items():\r
                 self[Key1] = Val1\r
         if len(Kwargs):\r
@@ -529,7 +529,7 @@ class PathClass(object):
     ## _GetFileKey\r
     #\r
     def _GetFileKey(self):\r
-        if self._Key == None:\r
+        if self._Key is None:\r
             self._Key = self.Path.upper()\r
         return self._Key\r
     ## Validate\r