Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue on errror #118

Closed
wants to merge 9 commits into from
Closed

Conversation

MrSeccubus
Copy link
Contributor

As a user I work with email addresses that I get from an external party (in this case abuse email addreses from ipinfo.io)

Sometimes these email addresses contain errors that cause the smtp server to report them back to me and fail. I would like it if the software automatically continues/resumes with the next record instead of having to do that manually.

Also I would like to have a log file (in csv format) so that I know which email were not sent.

@codecov-io
Copy link

codecov-io commented Mar 13, 2021

Codecov Report

Merging #118 (d82855f) into develop (283c2e8) will decrease coverage by 2.26%.
The diff coverage is 87.69%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #118      +/-   ##
===========================================
- Coverage    99.05%   96.79%   -2.27%     
===========================================
  Files            6        7       +1     
  Lines          319      374      +55     
===========================================
+ Hits           316      362      +46     
- Misses           3       12       +9     
Impacted Files Coverage Δ
mailmerge/log.py 77.41% <77.41%> (ø)
mailmerge/__main__.py 98.02% <97.05%> (-1.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 283c2e8...d82855f. Read the comment docs.

@MrSeccubus
Copy link
Contributor Author

I see that the code fails to run on Python 2, but should we still deal with Python 2 given that it is an unsupported language?

Also I don't know how to address the codecov problems.

@MrSeccubus
Copy link
Contributor Author

This pull request should also address issue #96

@MrSeccubus
Copy link
Contributor Author

@awdeorio the unit test that is failing is for a python version that is out of support. DO you really want me to fix that specific error?
Otherwise is there anything else that is holding up this PR?

@awdeorio
Copy link
Owner

@awdeorio the unit test that is failing is for a python version that is out of support. DO you really want me to fix that specific error?
Otherwise is there anything else that is holding up this PR?

Thanks for your patience. I know I've been slow on this and #114. I'll take a closer look at this after finishing up #114 and getting it merged.

Copy link
Owner

@awdeorio awdeorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow review. Thanks for your contributions! I left some comments.

@@ -10,7 +10,8 @@
import click
from .template_message import TemplateMessage
from .sendmail_client import SendmailClient
from . import exceptions
from .exceptions import MailmergeError
from .log import MailmergeLog
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would lean towards using Python's standard library logging mechanism over building a custom logger.

@@ -79,9 +84,15 @@
type=click.Choice(["colorized", "text", "raw"]),
help="Output format (colorized).",
)
@click.option(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that creating a log by default is reasonable. Maybe we can just call it mailmerge.log? That would simplify the command line interface.

.format(message_num=message_num),
output_format,
)
try:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this logic can be simplified after merging in the latest upstream develop. That includes a try-except block in the message send part.

@@ -0,0 +1,116 @@
# coding=utf-8
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More ideas for tests:

  • Log file already exists

@awdeorio awdeorio mentioned this pull request Jun 1, 2021
@MrSeccubus
Copy link
Contributor Author

Continueing this work in PR #124

@MrSeccubus MrSeccubus closed this Jun 2, 2021
@MrSeccubus MrSeccubus deleted the cont_on_error_and_log branch June 2, 2021 12:34
@MrSeccubus MrSeccubus restored the cont_on_error_and_log branch June 2, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants