SuperUserBot/utils.py
2024-04-28 23:18:06 +08:00

15 lines
405 B
Python

def datawrite(func):
def wrapper(self, *args, **kwargs):
result = func(self, *args, **kwargs)
self.export()
return result
return wrapper
def mutex(*args_, **kwargs_):
def w1(func):
def wrapper(self, *args, **kwargs):
with kwargs_["lock"]:
val = func(self, *args, **kwargs)
return val
return wrapper
return w1