Mercurial > libervia-backend
comparison sat/memory/memory.py @ 2698:5060cbeec01e
core: minor style/typos fixes
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 01 Dec 2018 10:04:17 +0100 |
parents | 56f94936df1e |
children | 378188abe941 |
comparison
equal
deleted
inserted
replaced
2697:fcc945537d5f | 2698:5060cbeec01e |
---|---|
628 ## History ## | 628 ## History ## |
629 | 629 |
630 def addToHistory(self, client, data): | 630 def addToHistory(self, client, data): |
631 return self.storage.addToHistory(data, client.profile) | 631 return self.storage.addToHistory(data, client.profile) |
632 | 632 |
633 def _historyGet( | 633 def _historyGet(self, from_jid_s, to_jid_s, limit=C.HISTORY_LIMIT_NONE, between=True, |
634 self, | 634 filters=None, profile=C.PROF_KEY_NONE): |
635 from_jid_s, | 635 return self.historyGet(jid.JID(from_jid_s), jid.JID(to_jid_s), limit, between, |
636 to_jid_s, | 636 filters, profile) |
637 limit=C.HISTORY_LIMIT_NONE, | 637 |
638 between=True, | 638 def historyGet(self, from_jid, to_jid, limit=C.HISTORY_LIMIT_NONE, between=True, |
639 filters=None, | 639 filters=None, profile=C.PROF_KEY_NONE): |
640 profile=C.PROF_KEY_NONE, | |
641 ): | |
642 return self.historyGet( | |
643 jid.JID(from_jid_s), jid.JID(to_jid_s), limit, between, filters, profile | |
644 ) | |
645 | |
646 def historyGet( | |
647 self, | |
648 from_jid, | |
649 to_jid, | |
650 limit=C.HISTORY_LIMIT_NONE, | |
651 between=True, | |
652 filters=None, | |
653 profile=C.PROF_KEY_NONE, | |
654 ): | |
655 """Retrieve messages in history | 640 """Retrieve messages in history |
656 | 641 |
657 @param from_jid (JID): source JID (full, or bare for catchall) | 642 @param from_jid (JID): source JID (full, or bare for catchall) |
658 @param to_jid (JID): dest JID (full, or bare for catchall) | 643 @param to_jid (JID): dest JID (full, or bare for catchall) |
659 @param limit (int): maximum number of messages to get: | 644 @param limit (int): maximum number of messages to get: |
660 - 0 for no message (returns the empty list) | 645 - 0 for no message (returns the empty list) |
661 - C.HISTORY_LIMIT_NONE or None for unlimited | 646 - C.HISTORY_LIMIT_NONE or None for unlimited |
662 - C.HISTORY_LIMIT_DEFAULT to use the HISTORY_LIMIT parameter value | 647 - C.HISTORY_LIMIT_DEFAULT to use the HISTORY_LIMIT parameter value |
663 @param between (bool): confound source and dest (ignore the direction) | 648 @param between (bool): confound source and dest (ignore the direction) |
664 @param filters (str): pattern to filter the history results (see bridge API for details) | 649 @param filters (dict[unicode, unicode]): pattern to filter the history results |
650 (see bridge API for details) | |
665 @param profile (str): %(doc_profile)s | 651 @param profile (str): %(doc_profile)s |
666 @return (D(list)): list of message data as in [messageNew] | 652 @return (D(list)): list of message data as in [messageNew] |
667 """ | 653 """ |
668 assert profile != C.PROF_KEY_NONE | 654 assert profile != C.PROF_KEY_NONE |
669 if limit == C.HISTORY_LIMIT_DEFAULT: | 655 if limit == C.HISTORY_LIMIT_DEFAULT: |