(self, name, word, isfile=False)
| 498 | return '' |
| 499 | |
| 500 | def send_msg(self, name, word, isfile=False): |
| 501 | uid = self.get_user_id(name) |
| 502 | if uid: |
| 503 | if isfile: |
| 504 | with open(word, 'r') as f: |
| 505 | result = True |
| 506 | for line in f.readlines(): |
| 507 | line = line.replace('\n', '') |
| 508 | print '-> ' + name + ': ' + line |
| 509 | if self.send_msg_by_uid(line, uid): |
| 510 | pass |
| 511 | else: |
| 512 | result = False |
| 513 | time.sleep(1) |
| 514 | return result |
| 515 | else: |
| 516 | if self.send_msg_by_uid(word, uid): |
| 517 | return True |
| 518 | else: |
| 519 | return False |
| 520 | else: |
| 521 | if self.DEBUG: |
| 522 | print '[ERROR] This user does not exist .' |
| 523 | return True |
| 524 | |
| 525 | @staticmethod |
| 526 | def search_content(key, content, fmat='attr'): |
nothing calls this directly
no test coverage detected