12345678910111213141516171819202122232425 |
- # -*- coding: utf-8 -*-
- # @Time : 2022/2/25 13:53
- # @Author : MaochengHu
- # @Email : wojiaohumaocheng@gmail.com
- # @File : config.py
- # @Project : server_develop
- class Config(object):
- def __init__(self, config_dict: dict):
- for key, val in config_dict.items():
- self.__setattr__(key, val)
- def copy(self, new_config_dict: dict):
- """
- Copies this config into a new config object, making
- the changes given by new_config_dict.
- """
- ret = Config(vars(self))
- for key, val in new_config_dict.items():
- ret.__setattr__(key, val)
- return ret
|