diff options
author | Kyomotoi <[email protected]> | 2023-01-06 17:09:12 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2023-01-06 17:09:12 +0800 |
commit | cbaa309976b8973124c7d66fbe3d50b970727905 (patch) | |
tree | 4548232992f0b7549d3fc513859efa099474690a /ATRI/plugins/manage | |
parent | 0ae2001ff6c50ed85fe970da8fbfc577a70488d5 (diff) | |
download | ATRI-cbaa309976b8973124c7d66fbe3d50b970727905.tar.gz ATRI-cbaa309976b8973124c7d66fbe3d50b970727905.tar.bz2 ATRI-cbaa309976b8973124c7d66fbe3d50b970727905.zip |
🎨 优化代码
Diffstat (limited to 'ATRI/plugins/manage')
-rw-r--r-- | ATRI/plugins/manage/data_source.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ATRI/plugins/manage/data_source.py b/ATRI/plugins/manage/data_source.py index e015805..ff344e7 100644 --- a/ATRI/plugins/manage/data_source.py +++ b/ATRI/plugins/manage/data_source.py @@ -144,11 +144,11 @@ class Manage: Only SUPERUSER. """ try: - data = ServiceTools().load_service(service) + data = ServiceTools(service).load_service() except Exception: return False data.enabled = is_enabled - ServiceTools().save_service(data.dict(), service) + ServiceTools(service).save_service(data.dict()) return True @staticmethod @@ -157,7 +157,7 @@ class Manage: Only SUPERUSER. """ try: - data = ServiceTools().load_service(service) + data = ServiceTools(service).load_service() except Exception: return False temp_list: list = data.disable_user @@ -174,7 +174,7 @@ class Manage: temp_list.append(user_id) data.disable_user = temp_list - ServiceTools().save_service(data.dict(), service) + ServiceTools(service).save_service(data.dict()) return True @staticmethod @@ -184,7 +184,7 @@ class Manage: Only current group. """ try: - data = ServiceTools().load_service(service) + data = ServiceTools(service).load_service() except Exception: return False temp_list: list = data.disable_group @@ -201,7 +201,7 @@ class Manage: temp_list.append(group_id) data.disable_group = temp_list - ServiceTools().save_service(data.dict(), service) + ServiceTools(service).save_service(data.dict()) return True @staticmethod |