1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00
django-mailbox/django_mailbox/management/commands/getmail.py

17 lines
569 B
Python
Raw Normal View History

import logging
2012-06-27 20:45:01 -07:00
from django.core.management.base import BaseCommand
from django_mailbox.models import Mailbox
2012-06-27 20:45:01 -07:00
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-mb', '--mailboxes', type=str, nargs='+', help='Write mailbox names')
parser.add_argument('-mr', '--max_read', type=int,
help='Write maximum number of email to read from each mailbox')
2012-06-27 20:45:01 -07:00
def handle(self, *args, **options):
logging.basicConfig(level=logging.INFO)
Mailbox.get_new_mail_all_mailboxes(options)