basic_usage.py 766 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env python2.7
  2. from datetime import timedelta
  3. import os
  4. import sys
  5. if os.getcwd() not in sys.path:
  6. sys.path.insert(0, os.getcwd())
  7. from pie_time import PieTime
  8. from pie_time.cards import ClockCard, PictureCard, WeatherCard
  9. deck = [
  10. ClockCard,
  11. (
  12. WeatherCard, 20, {
  13. 'api_key': 'Your OpenWeatherMap API KEY',
  14. 'city': 'Wroclaw,PL'
  15. }
  16. ),
  17. (
  18. PictureCard, 10, {
  19. 'urls': [
  20. 'http://lorempixel.com/320/240/city',
  21. 'http://lorempixel.com/200/125/technics'
  22. ]
  23. }
  24. )
  25. ]
  26. blanker_schedule = (
  27. timedelta(hours=23), timedelta(hours=6)
  28. )
  29. app = PieTime(deck, blanker_schedule=blanker_schedule)
  30. if __name__ == '__main__':
  31. app.run()