Skip to content

Commit

Permalink
update requirements & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
youfou committed Mar 19, 2017
1 parent 431faae commit 2b48811
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
wxpy: 用 Python 玩微信
==============================

微信机器人 / 优雅的微信个人号API,基于 `itchat <https://github.com/littlecodersh/itchat>`_,全面优化接口,更有 Python 范儿。
微信机器人 / 优雅的微信个人号API,基于 itchat,全面优化接口,更有 Python 范儿。


用来干啥
Expand Down
6 changes: 1 addition & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
wxpy: 用 Python 玩微信
==============================

微信机器人 / 优雅的微信个人号API,基于 |itchat|,全面优化接口,更有 Python 范儿。

.. |itchat| raw:: html

<a href="https://github.com/littlecodersh/itchat" target="_blank">itchat</a>
微信机器人 / 优雅的微信个人号API,基于 itchat,全面优化接口,更有 Python 范儿。


用来干啥
Expand Down
4 changes: 1 addition & 3 deletions docs/logging_with_wechat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

.. module:: wxpy

你是否曾守着电脑不肯走开,生怕错过一条重要的警告日志?或者当你外出时,心里挂念着电脑上的程序运行得如何?

现在,我们可以利用微信强大的通知能力,在微信上接收程序的日志。
通过利用微信强大的通知能力,我们可以把程序中的警告/日志发到自己的微信上。

wxpy 提供以下两种方式来实现这个需求。

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
itchat>=1.2.30
itchat>=1.2.32
requests
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
]
},
install_requires=[
'itchat>=1.2.30',
'itchat>=1.2.32',
'requests',
],
url='https://github.com/youfou/wxpy',
Expand Down
3 changes: 1 addition & 2 deletions wxpy/api/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from wxpy.api.chats import Chat, Chats, Friend, Group, MP, User
from wxpy.api.messages import Message, MessageConfig, Messages, Registered
from wxpy.api.messages import SYSTEM
from wxpy.exceptions import ResponseError
from wxpy.utils import ensure_list, get_user_name, handle_response, wrap_user_name

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -273,7 +272,7 @@ def request():
if user_name:
return Group(self.core.update_chatroom(userName=user_name), self)
else:
raise ResponseError('Failed to create group:\n{}'.format(pformat(ret)))
raise Exception('Failed to create group:\n{}'.format(pformat(ret)))

# messages / register

Expand Down
6 changes: 1 addition & 5 deletions wxpy/api/chats/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,7 @@ def get_avatar(self, save_path=None):

kwargs.update(picDir=save_path)

try:
return self.bot.core.get_head_img(**kwargs)
# 在 itchat 1.2.31 版本中,可能因 Python 版本兼容性问题而抛出 TypeError 异常
except TypeError:
pass
return self.bot.core.get_head_img(**kwargs)

def __repr__(self):
return '<{}: {}>'.format(self.__class__.__name__, self.name)
Expand Down

0 comments on commit 2b48811

Please sign in to comment.