我确信这很明显,但我很想念它。我已经通过pip安装了PyAPN:
# pip install apns
然后,当我尝试在APN中使用“增强”标志时,它就不存在了。
# python
Python 2.7.6 (default, Nov 11 2013, 18:34:29)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from apns import APNs
>>> server = APNs(use_sandbox=True, cert_file=“/mydir/apns-dev-cert.pem", key_file=“/mydir/apns-dev-key.pem", enhanced=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'enhanced'
>>>
果然安装pip的1.1.2版本没有该关键字。但我认为这是PyAPNs存储库https://github.com/djacobs/PyAPNs中最新发布的版本。
我想使用'enhanced'关键字进行错误检查。有什么想法吗?
答案 0 :(得分:2)
目前在PyPI上提供的版本1.1.2并未为enhanced
课程提供APNs
参数(请参阅source)。
如果您需要此功能,请直接从github(主分支)安装模块:
pip install git+https://github.com/djacobs/PyAPNs.git
请注意,他们尚未更新setup.py
中的软件包版本,因此,如果您已安装此模块,请先将其卸载,然后从github安装:
pip uninstall apns
pip install git+https://github.com/djacobs/PyAPNs.git
答案 1 :(得分:0)
如果你想要更多没有错误的版本,你可以试试这个fork
pip install git+https://github.com/jimhorng/PyAPNs.git
解决了长空闲连接中的错误: https://github.com/djacobs/PyAPNs/issues/94