# -*- coding:utf-8 -*-
# 作者：齐振鋆
# 日期：2022/11/9
# 描述:


class DataDic(object):
    __init_flag = False
    __instance = None

    def __new__(cls):
        if cls.__instance is None:
            cls.__instance = object.__new__(cls)
        return cls.__instance

    def __init__(self):
        if not DataDic.__init_flag:
            DataDic.__init_flag = True
            self.global_data = {}

    def set_value(self, key, value):
        self.global_data.setdefault(key, value)

    def get_value(self, key):
        return self.global_data.get(key)
