[PATCH v3 09/10] parsemail: Convert to a management command
stephenfinucane at hotmail.com
Fri Sep 2 00:19:10 AEST 2016
> Hi Stephen,
> > PYTHONPATH="$PATCHWORK_BASE":"$PATCHWORK_BASE/lib/python:$PYTHONPATH" \
> > DJANGO_SETTINGS_MODULE=patchwork.settings.production \
> > - "$PATCHWORK_BASE/patchwork/bin/parsemail.py"
> > + "$PATCHWORK_BASE/patchwork/manage.py parsemail" $@
> Looks good :)
> > +# NOTE(stephenfin): We must return 0 here. For more information, refer
> > +# to https://patchwork.ozlabs.org/patch/602248/
> > exit 0
> Could we just put the reason inline? Perhaps:
> "When parsemail is used as a delivery command from a mail server like
> postfix (as it is intended to be), a non-zero exit code will cause a
> bounce message to be returned to the user. We don't want to do that for
> a parse error, so always return 0."
OK, I'll do that when I merge.
> > +from email import message_from_file
> > +import logging
> > +from optparse import make_option
> As I mentioned for v2, this should be moved to argparse for Django 1.10
This breaks compatibility with Django 1.6 though, which we stillneed to support. I'll probably implement a compat library, but I'lldo this in a follow-up. Is that OK by you?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Patchwork