Skip to content

Commit

Permalink
Don't send AZW formats via mail
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Broer committed Mar 28, 2016
1 parent 13a024a commit e8b2ea8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cps/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ def send_mail(book_id, kindle_mail):
for entry in data:
if entry.format == "MOBI":
formats["mobi"] = os.path.join(config.DB_ROOT, book.path, entry.name + ".mobi")
if entry.format == "AZW":
formats["azw"] = os.path.join(config.DB_ROOT, book.path, entry.name + ".azw")
if entry.format == "AZW3":
formats["azw3"] = os.path.join(config.DB_ROOT, book.path, entry.name + ".azw3")
if entry.format == "EPUB":
formats["epub"] = os.path.join(config.DB_ROOT, book.path, entry.name + ".epub")
if entry.format == "PDF":
Expand All @@ -100,11 +96,7 @@ def send_mail(book_id, kindle_mail):
if len(formats) == 0:
return "Could not find any formats suitable for sending by email"

if 'azw3' in formats:
msg.attach(get_attachment(formats['azw3']))
elif 'azw' in formats:
msg.attach(get_attachment(formats['azw']))
elif 'mobi' in formats:
if 'mobi' in formats:
msg.attach(get_attachment(formats['mobi']))
elif 'epub' in formats:
filepath = make_mobi(book.id)
Expand Down

0 comments on commit e8b2ea8

Please sign in to comment.