egnchen / pyQQRobot

基于Python3与WebQQ协议的QQ机器人框架 A QQ robot framework based on WebQQ and Python3.
32 stars 6 forks source link

现在默认就是gevent,怎么使用原来的http? #9

Closed WuTianming closed 8 years ago

WuTianming commented 8 years ago

RT.

WuTianming commented 8 years ago

Fixed by reading the source code.

WuTianming commented 8 years ago

Traceback (most recent call last): File "./QQgetMsg.py", line 26, in a.load_veri(sys.argv[1]) File "/home/wtm/Working/QQRobot/qqrobot.py", line 258, in load_veri self.http_client.set_cookie(name, value, domain) File "/home/wtm/Working/QQRobot/qqhttp.py", line 55, in set_cookie raise NotImplementedError() NotImplementedError ^WTF?

WuTianming commented 8 years ago

难道没写完 是不是因为还在测试?

egnchen commented 8 years ago

You must have imported the wrong class. Use:

from qqhttp import mHTTPClient_urllib

instead of:

from qqhttp import mHTTPClient

then

a = QQClient(HTTPClient=mHTTPClient_urllib)

mHTTPClient is the base class, or framework, only contains abstract methods. mHTTPClient_urllib is its implementation.

WuTianming commented 8 years ago

@eyeKill 我知道了 我用的是QQClient(HTTPClient=mHTTPClient),就这里出问题了,谢谢

egnchen commented 8 years ago

On the other hand, I'm going to abandon qqhttp and use requests library instead. I gotta say, it's like hell to maintain a http library for a small project.