core.utils package¶
eonvelope.utils package containing utility for Eonvelope project.
- class core.utils.FetchingCriterion(criterion, argument='')[source]¶
Bases:
objectClass encapsulating the fetching-criterion logic.
- Parameters:
criterion (EmailFetchingCriterionChoices)
argument (str)
- __init__(criterion, argument='')[source]¶
Constructor.
- Parameters:
criterion (
EmailFetchingCriterionChoices) – One of the class:core.constants.EmailFetchingCriterionChoices.argument (
str) – Argument for the criterion. Defaults to “”.
- Return type:
None
- __str__()[source]¶
The formatted criterion as a string.
- Return type:
- Returns:
The formatted string criterion.
- validate()[source]¶
Checks if this fetching criterion is valid.
Note
Things that are NOT validated here: - Availability of the criterion for the mailbox of fetcher. - Existence of the criterion in general (covered by checking the above)
- Raises:
ValueError – If this fetching criterion is invalid.
- Return type:
- as_imap_criterion()[source]¶
Returns the formatted criterion for the IMAP request, handles dates in particular.
Note
There’s no need to use timezone.now here as only the date part is used.
- Return type:
- Returns:
Formatted criterion to be used in IMAP request.
- as_jmap_filter()[source]¶
Returns the filter-condition for the JMAP Email/query request.
- Return type:
EmailQueryFilterCondition- Returns:
The filter-condition to be used in JMAP request.
- as_exchange_queryset(base_query)[source]¶
Returns the queryset for the Exchange request.
Note
Use no timezone here to use the mailserver time settings.
- Parameters:
base_query (
QuerySet) – The query to extend based on the criterion.- Return type:
QuerySet- Returns:
Augmented queryset to be used in Exchange request.
Subpackages¶
- core.utils.fetchers package
- Submodules
- core.utils.fetchers.BaseFetcher module
- core.utils.fetchers.ExchangeFetcher module
- core.utils.fetchers.IMAP4Fetcher module
- core.utils.fetchers.IMAP4_SSL_Fetcher module
- core.utils.fetchers.JMAPFetcher module
- core.utils.fetchers.POP3Fetcher module
- core.utils.fetchers.POP3_SSL_Fetcher module
- core.utils.fetchers.SafeIMAPMixin module
- core.utils.fetchers.SafePOPMixin module
- core.utils.fetchers.exceptions module
- Submodules