]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Table/TableFile.py
BaseTools: Use absolute import in Table
[mirror_edk2.git] / BaseTools / Source / Python / Table / TableFile.py
index e43802ef25dfdcd8f73d03a094fc7f18ca93f12d..689264c2578a572ed2abd5a32f1cd712a40c6c35 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for files\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 ##\r
 # Import Modules\r
 #\r
+from __future__ import absolute_import\r
 import Common.EdkLogger as EdkLogger\r
-from Table import Table\r
-from Common.String import ConvertToSqlString\r
-import os\r
+from .Table import Table\r
+from Common.StringUtils import ConvertToSqlString\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.DataClass import FileClass\r
 \r
 ## TableFile\r
 #\r
 # This class defined a table used for file\r
-# \r
+#\r
 # @param object:       Inherited from object class\r
 #\r
 class TableFile(Table):\r
     def __init__(self, Cursor):\r
         Table.__init__(self, Cursor)\r
         self.Table = 'File'\r
-    \r
+\r
     ## Create table\r
     #\r
     # Create table File\r
@@ -72,15 +73,15 @@ class TableFile(Table):
         SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, '%s')""" \\r
                                            % (self.Table, self.ID, Name, ExtName, Path, FullPath, Model, TimeStamp)\r
         Table.Insert(self, SqlCommand)\r
-        \r
+\r
         return self.ID\r
     ## InsertFile\r
     #\r
     # Insert one file to table\r
     #\r
     # @param FileFullPath:  The full path of the file\r
-    # @param Model:         The model of the file \r
-    # \r
+    # @param Model:         The model of the file\r
+    #\r
     # @retval FileID:       The ID after record is inserted\r
     #\r
     def InsertFile(self, FileFullPath, Model):\r
@@ -89,7 +90,7 @@ class TableFile(Table):
         TimeStamp = os.stat(FileFullPath)[8]\r
         File = FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '', [], [], [])\r
         return self.Insert(File.Name, File.ExtName, File.Path, File.FullPath, File.Model, TimeStamp)\r
-    \r
+\r
     ## Get ID of a given file\r
     #\r
     #   @param  FilePath    Path of file\r