コード例 #1
0
ファイル: server.py プロジェクト: azk/bottle_exercise
def year_view(year):
	
	tbl = render_calendar(year)
	soup = BeautifulSoup(tbl)
	soup = transforms.format_table(soup)
	soup = transforms.add_month_links(soup,year)

	return template("main",cal_table=str(soup),
		prev=_a(year-1),next=_a(year+1),_type="year")
コード例 #2
0
ファイル: server.py プロジェクト: azk/bottle_exercise
def month_view(year = None, month = None):

	if not (year or month):
		now = datetime.datetime.now()
		year = now.year
		month = now.month

	tbl = render_calendar(year,month)

	soup = BeautifulSoup(tbl)
	soup = transforms.format_table(soup)
	soup = transforms.add_weather(soup,year,month,True)
	
	prev_next = _prev_next_month(year,month)

	return template("main",cal_table=str(soup),
		prev=prev_next[0],next=prev_next[1],
		year=_a(year),_type="month")