Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. def send_mail(self, book_text):
  2. ts = time.time()
  3. date = datetime.datetime.fromtimestamp(ts).strftime('%Y%m%d')
  4. book_title = 'Update' + date + '.txt'
  5. mail.send_mail(sender="my_gmail_addr@gmail.com",
  6. to="my_kindle_addr@kindle.com",
  7. subject="convert",
  8. body="",
  9. attachments=[(book_title, book_text)])
  10.  
  11. version: 1
  12. runtime: python27
  13. api_version: 1
  14. threadsafe: true
  15.  
  16. handlers:
  17. - url: /update
  18. script: update.app
  19. login: admin
  20.  
  21. cron:
  22. - description: daily update
  23. url: /update
  24. schedule: every day 18:00
  25. timezone: America/Indiana/Vevay
  26.  
  27. mail.send_mail(sender="my_gmail_addr@gmail.com",
  28. to="my_kindle_addr@kindle.com",
  29. subject="convert",
  30. body=book_title,
  31. attachments=[(book_title, book_text)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement