本文整理汇总了Python中newebe.lib.http_util.ContactClient.delete方法的典型用法代码示例。如果您正苦于以下问题:Python ContactClient.delete方法的具体用法?Python ContactClient.delete怎么用?Python ContactClient.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类newebe.lib.http_util.ContactClient
的用法示例。
在下文中一共展示了ContactClient.delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_deletion_to_contacts
# 需要导入模块: from newebe.lib.http_util import ContactClient [as 别名]
# 或者: from newebe.lib.http_util.ContactClient import delete [as 别名]
def send_deletion_to_contacts(self, path, doc):
'''
Send a delete request (PUT because Tornado don't handle DELETE request
with a body) to all trusted contacts.
Request body contains object to delete at JSON format.
'''
contacts = ContactManager.getTrustedContacts()
client = ContactClient(self.activity)
date = date_util.get_db_date_from_date(doc.date)
for contact in contacts:
try:
client.delete(contact, path, doc.toJson(localized=False), date)
except HTTPError:
import pdb
pdb.set_trace()
self.activity.add_error(contact, extra=date)
self.activity.save()