Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
add a parameter in method
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jan 18, 2016
1 parent b0f32a5 commit 4eab892
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/pymmails/grabber/mailboximap.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def enumerate_search_person(self,
folder,
skip_function=None,
date=None,
max_dest=5):
max_dest=5,
body=True):
"""
enumerates all mails in folder folder from a user or sent to a user
Expand All @@ -201,6 +202,7 @@ def enumerate_search_person(self,
@param skip_function if not None, use this function on the header/body to avoid loading the entire message (and skip it)
@param pattern search pattern (see below)
@param max_dest maximum number of receivers
@param body get the body
@return iterator on (message)
If *person* is a list, the function iterates on the list of
Expand All @@ -209,11 +211,9 @@ def enumerate_search_person(self,
if isinstance(person, list):
unique_id = set()
for p in person:
mail_set = self.enumerate_search_person(p,
folder=folder,
skip_function=skip_function,
date=date,
max_dest=max_dest)
mail_set = self.enumerate_search_person(p, folder=folder,
skip_function=skip_function, date=date,
max_dest=max_dest, body=body)
for mail in mail_set:
uid = mail.UniqueID
if uid not in unique_id:
Expand All @@ -223,8 +223,8 @@ def enumerate_search_person(self,
pat1 = 'FROM "{0}"'.format(person)
if date is not None:
pat1 += ' SINCE {0}'.format(date)
for mail in self.enumerate_mails_in_folder(
folder, skip_function=skip_function, pattern=pat1):
for mail in self.enumerate_mails_in_folder(folder, skip_function=skip_function,
pattern=pat1, body=body):
yield mail
pat2 = 'TO "{0}"'.format(person)
if date is not None:
Expand Down

0 comments on commit 4eab892

Please sign in to comment.