python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | earth2mip/xarray/metrics.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | earth2mip/xarray/__init__.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | earth2mip/xarray/utils.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | docs/conf.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | examples/workflows/pangu_24.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | examples/workflows/dlwp.py |
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | earth2mip-main | examples/workflows/fcnv2_sm.py |
#!/usr/bin/python
#
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/CryptoPkg/Library/OpensslLib/openssl/fuzz/helper.py |
# @file Edk2ToolsBuild.py
# Invocable class that builds the basetool c files.
#
# Supports VS2017, VS2019, and GCC5
##
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import sys
import logging
import argparse
import multiprocessing
from edk2toolext import edk2_logging... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Edk2ToolsBuild.py |
## @file
#
#
# Copyright (c) 2009 - 2014, Apple Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
import sys
import locale
if sys.platform == "darwin" and sys.version_info[0] < 3:
DefaultLocal = locale.getdefaultlocale()[1]
if DefaultLocal is None:
DefaultLocal = 'UTF8'
sys.setde... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/sitecustomize.py |
## @file
# generate capsule
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from .GenFdsGlobalVariable import GenFdsGlobalVariable, FindExtendTool
from CommonDataClass.FdfClass i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Capsule.py |
## @file
# process FFS generation
#
# Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from Common.DataType import *
# mapping between FILE type in FDF and file type for GenFfs
FdfFvFileTypeToFileType = {
SUP_MODULE_SEC... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Ffs.py |
## @file
# process depex section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Section
from .GenFdsGlobalVariable import GenFdsGlobalVariable
import Co... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/DepexSection.py |
## @file
# generate capsule
#
# Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from .GenFdsGlobalVariable import GenFdsGlobalVariable
from io import BytesIO
from struct import pack
im... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/CapsuleData.py |
## @file
# process compress section generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from .Ffs import SectionSuffix
from . import Section
import subprocess
import Commo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/CompressSection.py |
## @file
# process FD Region generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from struct import *
from .GenFdsGlobalVariable import GenFdsGlobalVariable
from io import... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Region.py |
## @file
# process FV image section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Section
from io import BytesIO
from .Ffs import SectionSuffix
import ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/FvImageSection.py |
## @file
# process OptionROM generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import Common.LongFilePathOs as os
import subprocess
from . import OptRomInfStatement
fro... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/OptionRom.py |
## @file
# parse FDF file
#
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import print_function
from __future__ import absolute_i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/FdfParser.py |
## @file
# Python 'GenFds' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/__init__.py |
## @file
# Complex Rule object for generating FFS
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Rule
from CommonDataClass.FdfClass import RuleComplexFileClassObject
##... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/RuleComplexFile.py |
## @file
# process GUIDed section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/GuidSection.py |
## @file
# process FFS generation from FILE statement
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from io import BytesIO
from struct import pack
from CommonDataClass.FdfClass... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/FfsFileStatement.py |
## @file
# process UI section generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Section
from .Ffs import SectionSuffix
import subprocess
import Common.Long... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/UiSection.py |
## @file
# section base class
#
# Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from CommonDataClass.FdfClass import SectionClassObject
from .GenFdsGlobalVariable import GenFdsGlobal... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Section.py |
## @file
# process data section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Section
from .GenFdsGlobalVariable import GenFdsGlobalVariable
import sub... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/DataSection.py |
## @file
# Global variables for GenFds
#
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import print_function
from __future__ import absolute_import
import Common.LongFilePathOs as os
import sys
from s... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |
## @file
# process FV generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import Common.LongFilePathOs as os
import subprocess
from io import BytesIO
from struct import *
... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Fv.py |
## @file
# process FFS generation from INF statement
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/FfsInfStatement.py |
## @file
# process APRIORI file data and generate PEI/DXE APRIORI file
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from struct import pack
import Common.LongFilePathOs as os
... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/AprioriSection.py |
## @file
# process OptionROM generation from INF statement
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import RuleSimpleFile
from . import RuleComplexFile
from . impor... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/OptRomInfStatement.py |
## @file
# Rule object for generating FFS
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from CommonDataClass.FdfClass import RuleClassObject
## Rule base class
#
#
class Rule(RuleClassObject):
## The constructor
#... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Rule.py |
## @file
# Simple Rule object for generating FFS
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Rule
from CommonDataClass.FdfClass import RuleSimpleFileClassObject
## si... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/RuleSimpleFile.py |
## @file
# process rule section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from struct import *
from . import Section
from .GenFdsGlobalVariable import GenFdsGlob... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/EfiSection.py |
## @file
# process Version section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from .Ffs import SectionSuffix
import Common.LongFilePathOs as os
from .GenFdsGlobal... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/VerSection.py |
## @file
# process OptionROM generation from FILE statement
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import Common.LongFilePathOs as os
from .GenFdsGlobalVariable import ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/OptRomFileStatement.py |
## @file
# generate flash image
#
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import print_function
from __future__ import absolute_import
from re import compile
from optparse import OptionParser
fro... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/GenFds.py |
## @file
# process FD generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Region
from . import Fv
import Common.LongFilePathOs as os
from io import BytesIO
i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/Fd.py |
## @file
# process Subtype GUIDed section generation
#
# Copyright (c) 2022, Konstantin Aladyshev <aladyshev22@gmail.com>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from . import Section
import subprocess
from .Ffs import SectionSuffix
import Commo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/GenFds/SubTypeGuidSection.py |
# @file
# Split a file into two pieces at the request offset.
#
# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/Split/__init__.py |
# @file
# Split a file into two pieces at the request offset.
#
# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
import argparse
import os
import io
import shutil
import logging
import sys
import tempfile
parser = argparse.Ar... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/Split/Split.py |
## @file
#
# Convert an AML file to a .c file containing the AML bytecode stored in a
# C array.
# By default, "Tables\Dsdt.aml" will generate "Tables\Dsdt.c".
# "Tables\Dsdt.c" will contain a C array named "dsdt_aml_code" that contains
# the AML bytecode.
#
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
#... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/AmlToC/AmlToC.py |
## @file
# This file is used to define the Firmware Storage Format.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/FirmwareStorageFormat/__init__.py |
## @file
# This file is used to define the common C struct and functions.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from ctypes import *
import uuid
# ZeroGuid = uuid.UUID('{00000000-0000-0000-0000-000000000000}')
# EFI_FIRMWARE_FILE_SYSTEM2_... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/FirmwareStorageFormat/Common.py |
## @file
# This file is used to define the FV Header C Struct.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from ast import Str
from struct import *
from ctypes import *
from FirmwareStorageFormat.Common import *
class EFI_FV_BLOCK_MAP_ENTRY(Str... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py |
## @file
# This file is used to define the Ffs Header C Struct.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from struct import *
from ctypes import *
from FirmwareStorageFormat.Common import *
EFI_FFS_FILE_HEADER_LEN = 24
EFI_FFS_FILE_HEADER2_L... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py |
## @file
# This file is used to define the Section Header C Struct.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from struct import *
from ctypes import *
from FirmwareStorageFormat.Common import *
EFI_COMMON_SECTION_HEADER_LEN = 4
EFI_COMMON_SE... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py |
## @file
# Install distribution package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
MkPkg
'''
##
# Import Modules
#
from os import remove
from os import getcwd
from os import chdir
import os.path
from sys import stdin
from sys impo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/MkPkg.py |
## @file
# Replace distribution package.
#
# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""
Replace a distribution package
"""
##
# Import Modules
#
from shutil import rmtree
from traceback import format_exc
from platform import python_versi... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/ReplacePkg.py |
## @file
#
# This file is for build version number auto generation
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Build version information
'''
gBUILD_VERSION = "Developer Build based on Revision: Unknown"
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/BuildVersion.py |
## @file
#
# This file is the main entry for UPT
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
UPT
'''
## import modules
#
import locale
import sys
from imp import reload
encoding = locale.getdefaultlocale()[1]
if encoding:
reload... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UPT.py |
## @file
# Inventory workspace's distribution package information.
#
# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""
Inventory workspace's distribution package information.
"""
##
# Import Modules
#
from sys import platform
from traceback i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/InventoryWs.py |
# # @file
# Test Install distribution package
#
# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""
Test Install multiple distribution package
"""
# #
# Import Modules
#
from Library import GlobalData
import Logger.Log as Logger
from Logger imp... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/TestInstall.py |
## @file
# Install distribution package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
RmPkg
'''
##
# Import Modules
#
import os.path
from stat import S_IWUSR
from traceback import format_exc
from platform import python_version
from h... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/RmPkg.py |
## @file
# Install distribution package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""
Install a distribution package
"""
##
# Import Modules
#
from Core.FileHook import __FileHookOpen__
import os.path
from os import chmod
from os impor... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/InstallPkg.py |
## @file
# This file contain unit test for DecParser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
import os
import unittest
from Logger.Log import FatalError
from Parser.DecParser import \
Dec, \
_DecDefine, \
_DecLibraryclass,... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py |
## @file
# This file contain unit test for Test [Binary] section part of InfParser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
from __future__ import print_function
import os
#import Object.Parser.InfObject as InfObject
from Object.Parser.... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py |
## @file
# This file contain unit test for CommentParsing
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
import unittest
import Logger.Log as Logger
from Library.CommentParsing import ParseHeaderCommentSection, \
... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py |
## @file
# This file contain unit test for CommentParsing
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
import os
import unittest
import Logger.Log as Logger
from GenMetaFile.GenInfFile import GenGuidSections
from GenMetaFile.GenInfFile imp... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py |
## @file
# This file contain unit test for DecParser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
from __future__ import print_function
import os
import unittest
from Parser.DecParserMisc import \
IsValidCArray, \
IsValidPcdDatum
... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py |
## @file
# This file is for installed package information database operations
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Dependency
'''
##
# Import Modules
#
from os.path import dirname
import os
import Logger.Log as Logger
from L... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/DependencyRules.py |
## @file
# This file hooks file and directory creation and removal
#
# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
File hook
'''
import os
import stat
import time
import zipfile
from time import sleep
from Library import GlobalData
__b... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/FileHook.py |
## @file
#
# PackageFile class represents the zip file of a distribution package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
PackageFile
'''
##
# Import Modules
#
import os.path
import zipfile
import tempfile
import platform
from ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/PackageFile.py |
## @file
# Python 'Library' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Core init file
'''
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/__init__.py |
## @file
# This file is used to define a class object to describe a distribution package
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
DistributionPackageClass
'''
##
# Import Modules
#
import os.path
from Library.Misc import Sdict
fro... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py |
## @file
# This file is for installed package information database operations
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
IpiDb
'''
##
# Import Modules
#
import sqlite3
import os.path
import time
import Logger.Log as Logger
from Lo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Core/IpiDb.py |
## @file
# This file is used to define strings used in the UPT tool
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
"""
This file contains user visible strings in a format that can be used for
localization
"""
import gettext
#
# string tab... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Logger/StringTable.py |
## @file
# This file implements the log mechanism for Python tools.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Logger
'''
## Import modules
from sys import argv
from sys import stdout
from sys import stderr
import os.path
from os i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Logger/Log.py |
## @file
# Python 'Logger' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Logger
'''
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Logger/__init__.py |
## @file
# Standardized Error Handling infrastructures.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
ToolError
'''
import Logger.StringTable as ST
FILE_OPEN_FAILURE = 1
FILE_WRITE_FAILURE = 2
FILE_PARSE_FAILURE = 3
FILE_READ_FAILURE... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Logger/ToolError.py |
## @file
# Common routines used by all tools
#
# Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Misc
'''
##
# Import Modules
#
import os.path
from os import access
from os import F_OK
from os import makedirs
from os import getcwd
from os i... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/Misc.py |
## @file
# Collect all defined strings in multiple uni files.
#
# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""
Collect all defined strings in multiple uni files
"""
from __future__ import print_function
##
# Import Modules
#
import os, co... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/UniClassObject.py |
## @file
# This file is used to define common static strings and global data used by UPT
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
GlobalData
'''
#
# The workspace directory
#
gWORKSPACE = '.'
gPACKAGE_PATH = None
#
# INF module di... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/GlobalData.py |
## @file
# This file is used to define common parsing related functions used in parsing
# INF/DEC/DSC process
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Parsing
'''
from __future__ import absolute_import
##
# Import Modules
#
impor... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/Parsing.py |
## @file
# This file is used to define common string related functions used in parsing
# process
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
StringUtils
'''
##
# Import Modules
#
import re
import os.path
import Logger.Log as Logger
im... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/StringUtils.py |
## @file
# Python 'Library' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Library
'''
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/__init__.py |
## @file
# This file is used to check PCD logical expression
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
ExpressionValidate
'''
from __future__ import print_function
##
# Import Modules
#
import re
from Logger import StringTable as ST... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py |
## @file
# This file is used to define comment generating interface
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
CommentGenerating
'''
##
# Import Modules
#
from Library.StringUtils import GetSplitValueList
from Library.DataType impo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/CommentGenerating.py |
## @file
# This file is used to define class for data type structure
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
# Portions Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
DataType
'''
##
# Module Lis... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/DataType.py |
## @file
# This file is used to define comment parsing interface
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
CommentParsing
'''
##
# Import Modules
#
import re
from Library.StringUtils import GetSplitValueList
from Library.StringUt... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/CommentParsing.py |
## @file ParserValidate.py
# Functions for parser validation
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
ParserValidate
'''
import os.path
import re
import platform
from Library.DataType import MODULE_LIST
from Library.DataType imp... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/ParserValidate.py |
## @file
# This is an XML API that uses a syntax similar to XPath, but it is written in
# standard python so that no extra python packages are required to use it.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
XmlRoutines
'''
##
# Impo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py |
## @file
# Python 'Library' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Xml
'''
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Library/Xml/__init__.py |
## @file
# This file contained the parser for [Pcds] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfPcdSectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Logger import StringTable as ST
from... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py |
## @file
# This file contained the parser for [Depex] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfDepexSectionParser
'''
##
# Import Modules
#
import re
import Logger.Log as Logger
from Logger import StringTabl... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py |
## @file
# This file contained the parser for INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfParser
'''
##
# Import Modules
#
import re
import os
from copy import deepcopy
from Library.StringUtils import GetSplitValueList
... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfParser.py |
## @file
# This file contained the parser for BuildOption sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfBuildOptionSectionParser
'''
##
# Import Modules
#
from Library import DataType as DT
from Library import G... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py |
## @file
# This file contained the parser for [Binaries] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfBinarySectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Logger import StringTable as ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py |
## @file
# This file contained the parser for [Sources] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfSourceSectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Logger import StringTable as S... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py |
## @file
# This file contained the parser for [Guids], [Ppis], [Protocols] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfGuidPpiProtocolSectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Lo... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py |
## @file
# Python 'Parser' package initialization file.
#
# This file is required to make Python interpreter treat the directory
# as containing package.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
Parser
'''
| nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/__init__.py |
## @file
# This file is used to provide method for process AsBuilt INF file. It will consumed by InfParser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
InfAsBuiltProcess
'''
## Import modules
#
import os
import re
from Library import Gl... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py |
## @file
# This file contained the miscellaneous functions for INF parser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfParserMisc
'''
##
# Import Modules
#
import re
from Library import DataType as DT
from Library.StringUtils ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py |
## @file
# This file is used to define helper class and function for DEC parser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
DecParserMisc
'''
## Import modules
#
import os
import Logger.Log as Logger
from Logger.ToolError import FILE_... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py |
## @file
# This file contained the parser for [Libraries] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfLibrarySectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Logger import StringTable a... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py |
## @file
# This file is used to parse DEC file. It will consumed by DecParser
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
DecParser
'''
## Import modules
#
import Logger.Log as Logger
from Logger.ToolError import FILE_PARSE_FAILURE
from... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/DecParser.py |
## @file
# This file contained the parser for sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfSectionParser
'''
##
# Import Modules
#
from copy import deepcopy
import re
from Library.StringUtils import GetSplitVa... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py |
## @file
# This file contained the parser for [Packages] sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfPackageSectionParser
'''
##
# Import Modules
#
import Logger.Log as Logger
from Logger import StringTable as... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py |
## @file
# This file contained the parser for define sections in INF file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
InfDefineSectionParser
'''
##
# Import Modules
#
import re
from Library import DataType as DT
from Library import ... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py |
## @file
# This file is used to parse a xml file of .PKG file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
'''
XmlParserMisc
'''
from Object.POM.CommonObject import TextObject
from Logger.StringTable import ERR_XML_PARSER_REQUIRED_ITEM_MI... | nvtrust-main | infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.