diff options
Diffstat (limited to 'BaseTools/Source/Python/Table')
-rw-r--r-- | BaseTools/Source/Python/Table/Table.py | 22 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableDataModel.py | 16 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableDec.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableDsc.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableEotReport.py | 10 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableFdf.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableFile.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableFunction.py | 10 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableIdentifier.py | 8 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableInf.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TablePcd.py | 8 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableReport.py | 8 |
12 files changed, 76 insertions, 76 deletions
diff --git a/BaseTools/Source/Python/Table/Table.py b/BaseTools/Source/Python/Table/Table.py index c311df91c2..e89b99320d 100644 --- a/BaseTools/Source/Python/Table/Table.py +++ b/BaseTools/Source/Python/Table/Table.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase a common table
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -19,7 +19,7 @@ import Common.EdkLogger as EdkLogger ## TableFile
#
# This class defined a common table
-#
+#
# @param object: Inherited from object class
#
# @param Cursor: Cursor of the database
@@ -30,7 +30,7 @@ class Table(object): self.Cur = Cursor
self.Table = ''
self.ID = 0
-
+
## Create table
#
# Create a table
@@ -46,18 +46,18 @@ class Table(object): #
def Insert(self, SqlCommand):
self.Exec(SqlCommand)
-
+
## Query table
#
# Query all records of the table
- #
+ #
def Query(self):
EdkLogger.verbose("\nQuery tabel %s started ..." % self.Table)
SqlCommand = """select * from %s""" % self.Table
self.Cur.execute(SqlCommand)
for Rs in self.Cur:
EdkLogger.verbose(str(Rs))
-
+
TotalCount = self.GetCount()
EdkLogger.verbose("*** Total %s records in table %s ***" % (TotalCount, self.Table) )
EdkLogger.verbose("Query tabel %s DONE!" % self.Table)
@@ -70,7 +70,7 @@ class Table(object): SqlCommand = """drop table IF EXISTS %s""" % self.Table
self.Cur.execute(SqlCommand)
EdkLogger.verbose("Drop tabel %s ... DONE!" % self.Table)
-
+
## Get count
#
# Get a count of all records of the table
@@ -82,12 +82,12 @@ class Table(object): self.Cur.execute(SqlCommand)
for Item in self.Cur:
return Item[0]
-
+
## Generate ID
#
# Generate an ID if input ID is -1
#
- # @param ID: Input ID
+ # @param ID: Input ID
#
# @retval ID: New generated ID
#
@@ -96,14 +96,14 @@ class Table(object): self.ID = self.ID + 1
return self.ID
-
+
## Init the ID of the table
#
# Init the ID of the table
#
def InitID(self):
self.ID = self.GetCount()
-
+
## Exec
#
# Exec Sql Command, return result
diff --git a/BaseTools/Source/Python/Table/TableDataModel.py b/BaseTools/Source/Python/Table/TableDataModel.py index 2c37592fc6..f167e43359 100644 --- a/BaseTools/Source/Python/Table/TableDataModel.py +++ b/BaseTools/Source/Python/Table/TableDataModel.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for data models
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ from Common.StringUtils import ConvertToSqlString ## TableDataModel
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -30,7 +30,7 @@ class TableDataModel(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'DataModel'
-
+
## Create table
#
# Create table DataModel
@@ -62,13 +62,13 @@ class TableDataModel(Table): (Name, Description) = ConvertToSqlString((Name, Description))
SqlCommand = """insert into %s values(%s, %s, '%s', '%s')""" % (self.Table, self.ID, CrossIndex, Name, Description)
Table.Insert(self, SqlCommand)
-
+
return self.ID
-
+
## Init table
#
# Create all default records of table DataModel
- #
+ #
def InitTable(self):
EdkLogger.verbose("\nInitialize table DataModel started ...")
for Item in DataClass.MODEL_LIST:
@@ -77,7 +77,7 @@ class TableDataModel(Table): Description = Item[0]
self.Insert(CrossIndex, Name, Description)
EdkLogger.verbose("Initialize table DataModel ... DONE!")
-
+
## Get CrossIndex
#
# Get a model's cross index from its name
@@ -91,5 +91,5 @@ class TableDataModel(Table): self.Cur.execute(SqlCommand)
for Item in self.Cur:
CrossIndex = Item[0]
-
+
return CrossIndex
diff --git a/BaseTools/Source/Python/Table/TableDec.py b/BaseTools/Source/Python/Table/TableDec.py index 97139c58d8..faa18e309d 100644 --- a/BaseTools/Source/Python/Table/TableDec.py +++ b/BaseTools/Source/Python/Table/TableDec.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for dec datas
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ from Common.StringUtils import ConvertToSqlString ## TableDec
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -30,7 +30,7 @@ class TableDec(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Dec'
-
+
## Create table
#
# Create table Dec
@@ -90,14 +90,14 @@ class TableDec(Table): SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
Table.Insert(self, SqlCommand)
-
+
return self.ID
-
+
## Query table
#
- # @param Model: The Model of Record
+ # @param Model: The Model of Record
#
- # @retval: A recordSet of all found records
+ # @retval: A recordSet of all found records
#
def Query(self, Model):
SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
diff --git a/BaseTools/Source/Python/Table/TableDsc.py b/BaseTools/Source/Python/Table/TableDsc.py index 4ac54933aa..2277489518 100644 --- a/BaseTools/Source/Python/Table/TableDsc.py +++ b/BaseTools/Source/Python/Table/TableDsc.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for dsc datas
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ from Common.StringUtils import ConvertToSqlString ## TableDsc
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -30,7 +30,7 @@ class TableDsc(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Dsc'
-
+
## Create table
#
# Create table Dsc
@@ -90,14 +90,14 @@ class TableDsc(Table): SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
Table.Insert(self, SqlCommand)
-
+
return self.ID
-
+
## Query table
#
- # @param Model: The Model of Record
+ # @param Model: The Model of Record
#
- # @retval: A recordSet of all found records
+ # @retval: A recordSet of all found records
#
def Query(self, Model):
SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
diff --git a/BaseTools/Source/Python/Table/TableEotReport.py b/BaseTools/Source/Python/Table/TableEotReport.py index bccf25ca45..e8291b48d7 100644 --- a/BaseTools/Source/Python/Table/TableEotReport.py +++ b/BaseTools/Source/Python/Table/TableEotReport.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for ECC reports
#
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -24,7 +24,7 @@ import Eot.EotGlobalData as EotGlobalData ## TableReport
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -32,7 +32,7 @@ class TableEotReport(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Report'
-
+
## Create table
#
# Create table report
@@ -68,9 +68,9 @@ class TableEotReport(Table): % (self.Table, self.ID, ModuleID, ModuleName, ModuleGuid, SourceFileID, SourceFileFullPath, \
ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, Enabled)
Table.Insert(self, SqlCommand)
-
+
def GetMaxID(self):
SqlCommand = """select max(ID) from %s""" % self.Table
self.Cur.execute(SqlCommand)
for Item in self.Cur:
- return Item[0]
\ No newline at end of file + return Item[0]
diff --git a/BaseTools/Source/Python/Table/TableFdf.py b/BaseTools/Source/Python/Table/TableFdf.py index eea8e9404d..872afc79ef 100644 --- a/BaseTools/Source/Python/Table/TableFdf.py +++ b/BaseTools/Source/Python/Table/TableFdf.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for fdf datas
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ from Common.StringUtils import ConvertToSqlString ## TableFdf
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -30,7 +30,7 @@ class TableFdf(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Fdf'
-
+
## Create table
#
# Create table Fdf
@@ -91,14 +91,14 @@ class TableFdf(Table): SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
Table.Insert(self, SqlCommand)
-
+
return self.ID
-
+
## Query table
#
- # @param Model: The Model of Record
+ # @param Model: The Model of Record
#
- # @retval: A recordSet of all found records
+ # @retval: A recordSet of all found records
#
def Query(self, Model):
SqlCommand = """select ID, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine from %s
diff --git a/BaseTools/Source/Python/Table/TableFile.py b/BaseTools/Source/Python/Table/TableFile.py index ac762ea7fc..34a0b47418 100644 --- a/BaseTools/Source/Python/Table/TableFile.py +++ b/BaseTools/Source/Python/Table/TableFile.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for files
#
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -23,14 +23,14 @@ from CommonDataClass.DataClass import FileClass ## TableFile
#
# This class defined a table used for file
-#
+#
# @param object: Inherited from object class
#
class TableFile(Table):
def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'File'
-
+
## Create table
#
# Create table File
@@ -72,15 +72,15 @@ class TableFile(Table): SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, '%s')""" \
% (self.Table, self.ID, Name, ExtName, Path, FullPath, Model, TimeStamp)
Table.Insert(self, SqlCommand)
-
+
return self.ID
## InsertFile
#
# Insert one file to table
#
# @param FileFullPath: The full path of the file
- # @param Model: The model of the file
- #
+ # @param Model: The model of the file
+ #
# @retval FileID: The ID after record is inserted
#
def InsertFile(self, FileFullPath, Model):
@@ -89,7 +89,7 @@ class TableFile(Table): TimeStamp = os.stat(FileFullPath)[8]
File = FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '', [], [], [])
return self.Insert(File.Name, File.ExtName, File.Path, File.FullPath, File.Model, TimeStamp)
-
+
## Get ID of a given file
#
# @param FilePath Path of file
diff --git a/BaseTools/Source/Python/Table/TableFunction.py b/BaseTools/Source/Python/Table/TableFunction.py index 3d40bd61f6..bf301fd262 100644 --- a/BaseTools/Source/Python/Table/TableFunction.py +++ b/BaseTools/Source/Python/Table/TableFunction.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for functions
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -21,21 +21,21 @@ from Common.StringUtils import ConvertToSqlString ## TableFunction
#
# This class defined a table used for function
-#
+#
# @param Table: Inherited from Table class
#
class TableFunction(Table):
def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Function'
-
+
## Create table
#
# Create table Function
#
# @param ID: ID of a Function
# @param Header: Header of a Function
- # @param Modifier: Modifier of a Function
+ # @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
@@ -72,7 +72,7 @@ class TableFunction(Table): #
# @param ID: ID of a Function
# @param Header: Header of a Function
- # @param Modifier: Modifier of a Function
+ # @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
diff --git a/BaseTools/Source/Python/Table/TableIdentifier.py b/BaseTools/Source/Python/Table/TableIdentifier.py index 0ec8b3c162..5ce528b26a 100644 --- a/BaseTools/Source/Python/Table/TableIdentifier.py +++ b/BaseTools/Source/Python/Table/TableIdentifier.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for Identifiers
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -21,7 +21,7 @@ from Table import Table ## TableIdentifier
#
# This class defined a table used for Identifier
-#
+#
# @param object: Inherited from object class
#
#
@@ -29,7 +29,7 @@ class TableIdentifier(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Identifier'
-
+
## Create table
#
# Create table Identifier
@@ -87,4 +87,4 @@ class TableIdentifier(Table): % (self.Table, self.ID, Modifier, Type, Name, Value, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn)
Table.Insert(self, SqlCommand)
- return self.ID
\ No newline at end of file + return self.ID
diff --git a/BaseTools/Source/Python/Table/TableInf.py b/BaseTools/Source/Python/Table/TableInf.py index 478b77776e..c524256a0c 100644 --- a/BaseTools/Source/Python/Table/TableInf.py +++ b/BaseTools/Source/Python/Table/TableInf.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for inf datas
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ from Common.StringUtils import ConvertToSqlString ## TableInf
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -30,7 +30,7 @@ class TableInf(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Inf'
-
+
## Create table
#
# Create table Inf
@@ -96,14 +96,14 @@ class TableInf(Table): SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
Table.Insert(self, SqlCommand)
-
+
return self.ID
-
+
## Query table
#
- # @param Model: The Model of Record
+ # @param Model: The Model of Record
#
- # @retval: A recordSet of all found records
+ # @retval: A recordSet of all found records
#
def Query(self, Model):
SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
diff --git a/BaseTools/Source/Python/Table/TablePcd.py b/BaseTools/Source/Python/Table/TablePcd.py index ca1c0f0c8a..689ae22e89 100644 --- a/BaseTools/Source/Python/Table/TablePcd.py +++ b/BaseTools/Source/Python/Table/TablePcd.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for pcds
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -21,7 +21,7 @@ from Common.StringUtils import ConvertToSqlString ## TablePcd
#
# This class defined a table used for pcds
-#
+#
# @param object: Inherited from object class
#
#
@@ -29,7 +29,7 @@ class TablePcd(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Pcd'
-
+
## Create table
#
# Create table Pcd
@@ -87,4 +87,4 @@ class TablePcd(Table): % (self.Table, self.ID, CName, TokenSpaceGuidCName, Token, DatumType, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn)
Table.Insert(self, SqlCommand)
- return self.ID
\ No newline at end of file + return self.ID
diff --git a/BaseTools/Source/Python/Table/TableReport.py b/BaseTools/Source/Python/Table/TableReport.py index 9ce1d0aa25..1a039249ff 100644 --- a/BaseTools/Source/Python/Table/TableReport.py +++ b/BaseTools/Source/Python/Table/TableReport.py @@ -1,7 +1,7 @@ ## @file
# This file is used to create/update/query/erase table for ECC reports
#
-# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -25,7 +25,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open ## TableReport
#
# This class defined a table used for data model
-#
+#
# @param object: Inherited from object class
#
#
@@ -33,7 +33,7 @@ class TableReport(Table): def __init__(self, Cursor):
Table.__init__(self, Cursor)
self.Table = 'Report'
-
+
## Create table
#
# Create table report
@@ -78,7 +78,7 @@ class TableReport(Table): ## Query table
#
- # @retval: A recordSet of all found records
+ # @retval: A recordSet of all found records
#
def Query(self):
SqlCommand = """select ID, ErrorID, OtherMsg, BelongsToTable, BelongsToItem, Corrected from %s
|