Skip to content

Commit 0036939

Browse files
committed
chore(info): add InfoManager.renew_sig_info
1 parent 2f4a835 commit 0036939

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lagrange/info/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212

1313

1414
class InfoManager:
15-
def __init__(self, uin: int, device_info_path: Union[str, os.PathLike[str]], sig_info_path: Union[str, os.PathLike[str]], auto_save=True):
15+
def __init__(
16+
self,
17+
uin: int,
18+
device_info_path: Union[str, os.PathLike[str]],
19+
sig_info_path: Union[str, os.PathLike[str]],
20+
auto_save=True,
21+
):
1622
self.uin: int = uin
1723
self._device_info_path = Path(device_info_path)
1824
self._sig_info_path = Path(sig_info_path)
@@ -30,6 +36,9 @@ def sig_info(self) -> SigInfo:
3036
assert self._sig_info, "SigInfo not initialized"
3137
return self._sig_info
3238

39+
def renew_sig_info(self):
40+
self._sig_info = SigInfo.new()
41+
3342
def save_all(self):
3443
with self._sig_info_path.open("wb") as f:
3544
f.write(self.sig_info.dump())

0 commit comments

Comments
 (0)