Safe read and write opearation with file lock.

Added file locks.  -  avoiding data leaks.
file handle module  -  To handle file opearations safly.
Added filelock.py  -  licensed file.
linted the pdata.py  -  type checking and formating.
This commit is contained in:
pranav-1711 2022-02-26 16:22:18 +05:30
parent 7c67998dec
commit 9f4be5eb84
6 changed files with 694 additions and 264 deletions

View file

@ -90,7 +90,7 @@ class checkserver(object):
return
if settings["whitelist"] and ros["account_id"]!=None:
if ros["account_id"] not in pdata.whitelist:
if ros["account_id"] not in pdata.CacheData.whitelist:
_ba.screenmessage("Not in whitelist,contact admin",color=(1,0,0),transient=True,clients=[ros['client_id']])
logger.log(d_str+"||"+ros["account_id"]+" | kicked > not in whitelist")
_ba.disconnect_client(ros['client_id'])
@ -321,7 +321,7 @@ def save_age(age, pb_id,display_string):
def save_ids(ids,pb_id,display_string):
pdata.update_displayString(pb_id,ids)
pdata.update_display_string(pb_id,ids)
if display_string not in ids: