Advertisement
Guest User

diary routes in Bottle

a guest
Nov 29th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. # Start on first Diary page if no page given
  2. @route('/diary')
  3. def diary():
  4.     return diary(0)
  5.  
  6. # Diary Page - Diary Template - list all articles
  7. @route('/diary/<page:int>')
  8. def diary(page):
  9.     """diary page"""
  10.     loc = 'diary/entries/'
  11.     assert isinstance(page, int)
  12.     info = {'css': 'diary', 'title': 'blessfrey - developer diary', 'year': datetime.datetime.now(), 'snippets': list_snippets(gather_and_sort(loc)), 'latest': list_headlines(gather_and_sort(loc)[0:5]), 'total': len(curate_files(gather_files(loc))), 'limit': 8, 'cluster': 3, 'page': page}
  13.     return template('diary.tpl', info)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement