X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FTable%2FTableDataModel.py;fp=BaseTools%2FSource%2FPython%2FTable%2FTableDataModel.py;h=f167e433599a83c1dae19628151dbd2b49b8f812;hb=f7496d717357b9af78414d19679b073403812340;hp=2c37592fc67cdd504d7c0ca1d34e42b4d63bbec2;hpb=39456d00f36e04b7e7efb208f350f4e83b6c3531;p=mirror_edk2.git 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.
+# Copyright (c) 2008 - 2018, 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 @@ -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