Commit e3983dd9 authored by Zheng Yile's avatar Zheng Yile
Browse files


parent e091caa2
import json
import zlib
from base64 import b64decode
from import report
variables = {'cache_on': True}
def cache_load(file='./codiaclient.cache'):
if not variables['cache_on']:
report("Invalid reference of function 'cache_load'.", 1)
return False
with open(file, 'rb') as f:
dic_ziped =
dic_b64 = zlib.decompress(dic_ziped)
dic_str = b64decode(dic_b64).decode('utf-8')
config = json.loads(dic_str)
if 'logindic' in config: variables['logindic'] = config['logindic']
except (zlib.error, UnicodeDecodeError, json.decoder.JSONDecodeError):
report('Cache load failed.', 1)
except FileNotFoundError:
print(json.dumps(variables, indent=2))
input('Press any key to continue...')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment