1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3# 4# Copyright (c) 2024 Huawei Device Co., Ltd. 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17from enum import Enum 18 19JS_FILE = "test_constant_pool_content.js" 20 21API_VERSION_MAP = { 22 "API9": "9.0.0.0", 23 "API10": "9.0.0.0", 24 "API11": "11.0.2.0", 25 "API12beta1": "12.0.2.0", 26 "API12beta2": "12.0.2.0", 27 "API12beta3": "12.0.6.0", 28 "API13": "12.0.6.0", 29} 30 31 32# ANSI color codes for terminal output 33class Color(Enum): 34 WHITE = "\033[37m" 35 GREEN = "\033[92m" 36 RED = "\033[91m" 37 RESET = "\033[0m" 38 39 @staticmethod 40 def apply(color, text): 41 return f"{color.value}{text}{Color.RESET.value}"