|
26 | 26 | Any,
|
27 | 27 | )
|
28 | 28 | from collections import UserDict
|
| 29 | +from wechaty.config import config |
29 | 30 |
|
30 | 31 |
|
31 | 32 | class WechatySetting(UserDict):
|
@@ -83,3 +84,30 @@ def __setitem__(self, key: str, value: Any) -> None:
|
83 | 84 | def to_dict(self) -> dict:
|
84 | 85 | """return the dict data"""
|
85 | 86 | return self.read_setting()
|
| 87 | + |
| 88 | + |
| 89 | +# class QCloudSetting(WechatySetting): |
| 90 | +# """Tencent Cloud Object Storaging""" |
| 91 | +# def __init__(self, setting_file: str): |
| 92 | +# super().__init__(setting_file) |
| 93 | + |
| 94 | +# from qcloud_cos import CosConfig |
| 95 | +# from qcloud_cos import CosS3Client |
| 96 | + |
| 97 | +# secret_id = config.get_environment_variable("q_secret_id") |
| 98 | +# secret_key = config.get_environment_variable("q_secret_key") |
| 99 | +# region = config.get_environment_variable("q_secret_region") |
| 100 | +# self.bucket_name = config.get_environment_variable("bucket_name") |
| 101 | +# self.bucket_path_prefix: str = config.get_environment_variable("bucket_prefix", "") |
| 102 | + |
| 103 | +# cos_config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key) |
| 104 | +# self.client = CosS3Client(cos_config) |
| 105 | + |
| 106 | +# def read_setting(self) -> dict: |
| 107 | +# """read setting from q-cloud |
| 108 | + |
| 109 | +# Returns: |
| 110 | +# dict: the object of setting |
| 111 | +# """ |
| 112 | +# remote_path = os.path.join(self.bucket_path_prefix, self.setting_file) |
| 113 | +# self.client |
0 commit comments