import asyncio import time import redis import os import copy import json import traceback import inspect ''' umod # ''' p=print async def anop(*a,**kw):pass def nop(*a,**kw):pass def connect_redis(): return redis.Redis(host='localhost', port=6379, db=0,charset="utf-8", decode_responses=True, encoding_errors="backslashreplace") ''' # ''' class AclTaskMixin: async def ws_conn0(self): glob_cl.init_gcl(self) print("++++++++++++++++++++++++++") # oinfo(glob_cl) async def ws_conn_once(self,*a,**kw): print("\t\tws_conn_once:","AclTaskMixin") # GCLMixin class globCL(): def __init__(self,*a,**kw): # for now we are not going to do any weird class stuff self.r = connect_redis() pass async def persistent_loop(self,*a,**kw): pass def run_persistent_loop(self,*a,**kw): pass # RldManMixin class RldMan(): def __init__(self,*a,**kw): base_path = "/usr/games/repos/ign4/py_rld/djc/rdir1/" self.files = [ base_path+"", ] def add_files(self,files): for file in files: if type(file)==str: self.add_file(file) elif type(file)==list: self.add_file(*file) else: p("add files???",file) def add_file(self,file_name,fnx={}): self.files[file_name] = {"ftxt":"",**fnx} glob_cl = globCL() # print("..",end="\n",flush=True) def redis_info(): rconn = glob_cl.r keys = rconn.keys() for k in keys: p(":",k) p("len(keys)",len(keys)) print("",end="",flush=True) # rconn.flushall() redis_info() r""" def atexit_fn(): pass # rconn.flushall() print("ATEXIT FN") rinfo_len() keys = rconn.keys() print(keys) print(len(keys)) print("t 000") # time.sleep(10) print("t 010") # time.sleep(20) print("t 020") print("ATEXIT FN...") rconn.flushall() atexit.register(atexit_fn) # """