本文整理汇总了Python中DBManager.DBManager.deleteContact方法的典型用法代码示例。如果您正苦于以下问题:Python DBManager.deleteContact方法的具体用法?Python DBManager.deleteContact怎么用?Python DBManager.deleteContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.deleteContact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from DBManager import DBManager [as 别名]
# 或者: from DBManager.DBManager import deleteContact [as 别名]
if byID['cID'] == contID:
print "\t(+) Found contact by cID"
else:
print "\t(-) Could not find contact by cID"
#---------------------------------------------------------------------------------------------------------#
byInfo = db.findContact(fName=cont1['fName'], lName=cont1['lName'], email=cont1['email'], sms=cont1['sms'])
if byInfo['cID'] == contID:
print "\t(+) Found contact by information"
else:
print "\t(-) Could not find contact by information"
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing assignSession function"
db.assignSession(ses, fName=cont1['fName'], lName=cont1['lName'], email=cont1['email'], sms=cont1['sms'])
db.printSessions()
db.unassignSession(ses)
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing assignNode function"
db.assignNode(dev1, contID)
db.printNodes()
db.unassignNode(dev1)
#---------------------------------------------------------------------------------------------------------#
print "(=) Printing list of Contacts"
db.printContacts()
#---------------------------------------------------------------------------------------------------------#
print "(=) Cleaning up...."
db.deleteContact(contID)
db.deleteNode(dev1)
db.deleteNode(dev2)
db.deleteSession(ses)
db.close()
#---------------------------------------------------------------------------------------------------------#