diff options
Diffstat (limited to 'ATRI/modules/funcControl/__init__.py')
-rw-r--r-- | ATRI/modules/funcControl/__init__.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/ATRI/modules/funcControl/__init__.py b/ATRI/modules/funcControl/__init__.py deleted file mode 100644 index f4dac26..0000000 --- a/ATRI/modules/funcControl/__init__.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -import json -from pathlib import Path -from typing import Optional - - -def checkSwitch(funcName: str, g: int): - file = Path('.') / 'ATRI' / 'modules' / 'funcControl' / 'ALLswitch.json' - with open(file, 'r') as f: - data = json.load(f) - if data[funcName] == "off": - return False - else: - try: - file = Path('.') / 'ATRI' / 'data' / 'groupData' / f'{g}' / 'switch.json' - with open(file, 'r') as f: - data = json.load(f) - except: - try: - os.mkdir(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{g}') - except: - pass - data = {} - data["pixiv_seach_img"] = "on" - data["pixiv_seach_author"] = "on" - data["pixiv_daily_rank"] = "on" - data["setu"] = "on" - data["setu_img"] = "on" - data["anime_search"] = "on" - data["change_face"] = "on" - data["chouYou"] = "on" - data["saucenao_search"] = "on" - with open(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{g}' / 'switch.json', 'w') as f: - f.write(json.dumps(data)) - f.close() - - if data[funcName] == "on": - return True - -def checkNoob(u: int, g: Optional[int] = None): - fileU = Path('.') / 'ATRI' / 'plugins' / 'noobList' / 'noobList.json' - fileG = Path('.') / 'ATRI' / 'plugins' / 'noobList' / 'noobGroup.json' - try: - with open(fileU, 'r') as f: - dataU = json.load(f) - except: - dataU = {} - - try: - with open(fileG, 'r') as f: - dataG = json.load(f) - except: - dataG = {} - - if str(u) not in dataU.keys(): - if g: - if str(g) not in dataG.keys(): - return True - else: - return True - else: - pass
\ No newline at end of file |