Itchat

Latest version: v1.3.10

Safety actively analyzes 638699 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 3

1.2.0

主要更改
- 加入日志
- 更改返回值内容
- 完善多实例及退出
- 更新构架

加入日志

使用logging记录日志。

新增接口,设定日志输出位置(文件、控制台),类似这样操作:

python
itchat.set_logging(showOnCmd=True, loggingFile=None, loggingLevel=10)


更改返回值内容

使用能够记录更多信息的返回值,类似这样操作:

python
r.json() -> {'BaseResponse': {'Ret': 0 }}
r = ReturnValue(r.json())

if r:
print('True')
else:
print('False')

print(r['BaseResponse'])
{'Ret': 0}


完善多实例及退出

增加新实例接口与退出接口

python
itchat.new_instance()
itchat.logout()


更新构架

将本处于**init**.py中的方法也加入client

将client以初始化时加载形式组织

定义时方法仅作占位及注释作用

python
core.py 即原client.py
from .messages import load_messages_components

class Core(object):
def __init__(self):
self.__load_components()
def load_components(self):
load_messages_components(self)
def produce_msg(self, msg):
''' place for docs
* will be initialized in messages
'''
raise NotImplementedError()


python
messages.py

def load_components(core):
core.produce_msg = produce_msg

def produce_msg(self, msg):
pass

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.