Posted By

fontanon on 07/31/08


Tagged

calendar mediawiki


Versions (?)

Cleaning Calendar


 / Published in: Python
 

URL: cleaningCalendar.py

A simple and configurable python script to generate a cleaning calendar in mediawiki syntax

  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. # Author: J. Félix Ontañón <[email protected]>
  4.  
  5. import datetime
  6.  
  7. # Editar aqui el dia que se quiere que comience el calendioo
  8. today = datetime.date(2008,07,27)
  9. # Editar aqui el nombre de los sitios a limpiar
  10. places = [u'Salón', u'Terraza/Pasillo', u'Baño', u'Aseo/Pileta', u'Cocina']
  11. # Editar aqui el numero de semanas que se quiere que dure el calendario
  12. weeks = 54
  13.  
  14. template = "|- align='left'\n| %s - %s\n| %s\n| %s\n| %s\n| %s\n| %s"
  15. oneweek = datetime.timedelta(days=7)
  16. twodays = datetime.timedelta(days=2)
  17.  
  18. for week in range(1, weeks):
  19. firstday = today.strftime("%d %b")
  20. lastday = (today + twodays).strftime("%d %b")
  21.  
  22. print template % (firstday, lastday, places[0], places[1],
  23. places[2], places[3], places[4])
  24.  
  25. lastplace = places.pop()
  26. places.insert(0, lastplace)
  27.  
  28. today = today + oneweek

Report this snippet  

You need to login to post a comment.