Exemplo n.º 1
0
	def get(self):
		import define
		TZ = JST()
		kyou = datetime.datetime.now(TZ)
		tt = TagTool('', '')
		template_values = {'donichitag': tt.getDonichiTag(), 
							'defdate': define.getNextDonichiDate(datetime.datetime.now(JST())),
						  }
		#path = os.path.join(os.path.dirname(__file__), 'templates/main.html')
		path = os.path.join(os.path.dirname(__file__), 'templates/mains.html' if define.isMobile(self) else 'templates/main.html')
		self.response.out.write(template.render(path, template_values))
Exemplo n.º 2
0
	def get(self):
		try:
			ss = self.request.get('kaisaibi').split('-')
			youbi =  u"月 火 水 木 金 土 日".split()[datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday()]
			tt = TagTool('', '')
			template_values = {'kaisaibi': self.request.get('kaisaibi'), 
							   'youbi': youbi, 
							   'youbinum': datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday(),
							   'clstag': tt.getClsTag(),
							   'snktag': tt.getSankaTag(),
							  }
			path = os.path.join(os.path.dirname(__file__), 'templates/adds.html')
			self.response.out.write(template.render(path, template_values))
		except:
			self.redirect('/')
Exemplo n.º 3
0
	def get(self):
		try:
			sankaf, sankas, sankap, sankam, hoketsuf, hoketsus, hoketsup, hoketsum, yasumi = getSankaLists(self.request.get('kaisaibi'))
			ss = self.request.get('kaisaibi').split('-')
			#youbi =  u"日 月 火 水 木 金 土".split()[ datetime. datetime(int(ss[0]),int(ss[1]),int(ss[2])).isoweekday()]
			youbi =  u"月 火 水 木 金 土 日".split()[datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday()]
			tt = TagTool('', '')
			template_values = {'sankacnt': len(sankaf) + len(sankas)+ len(sankap)+len(sankam), 
							   'sankaf': sankaf, 
							   'sankafcnt': len(sankaf), 
							   'sankas': sankas, 
							   'sankascnt': len(sankas), 
							   'sankap': sankap, 
							   'sankapcnt': len(sankap), 
							   'sankam': sankam,
							   'sankamcnt': len(sankam),
							   'hoketsucnt':len(hoketsuf) + len(hoketsus) + len(hoketsup) + len(hoketsum), 
							   'hoketsuf': hoketsuf, 
							   'hoketsufcnt': len(hoketsuf), 
							   'hoketsus': hoketsus, 
							   'hoketsuscnt': len(hoketsus), 
							   'hoketsup': hoketsup, 
							   'hoketsupcnt': len(hoketsup), 
							   'hoketsum': hoketsum,
							   'hoketsumcnt': len(hoketsum),
							   'yasumi': yasumi,
							   'yasumicnt': len(yasumi),
							   'kaisaibi':self.request.get('kaisaibi'),
							   'youbi': youbi,
							   'clstag': tt.getClsTag(),
							   'snktag': tt.getSankaTag(),
							   'beforedate': define.getBeforeDonichiDate(datetime.datetime.strptime(self.request.get('kaisaibi'), '%Y-%m-%d') + datetime.timedelta(-1)),
							   'nearestdate': define.getNextDonichiDate(datetime.datetime.now(JST())),
							   'nextdate': define.getNextDonichiDate(datetime.datetime.strptime(self.request.get('kaisaibi'), '%Y-%m-%d') + datetime.timedelta(1)),
							   'sukatsuo': define.sukatsuo()
							  }
			#path = os.path.join(os.path.dirname(__file__), 'templates/insert.html')
			path = os.path.join(os.path.dirname(__file__), 'templates/inserts.html' if define.isMobile(self) else 'templates/insert.html')
			self.response.out.write(template.render(path, template_values))
		except:
			self.redirect('/')
Exemplo n.º 4
0
	def get(self):
		import define
		try:
			c = Comment.get_by_id(int(self.request.get('sankaid')))
			if(c is None): 
				self.redirect('/')
				return
			tt = TagTool(c.chara_class, c.sanka)
			ss = c.kaisaibi.split('-')
			#youbi =  u"日 月 火 水 木 金 土".split()[ datetime. datetime(int(ss[0]),int(ss[1]),int(ss[2])).isoweekday()]
			youbi =  u"月 火 水 木 金 土 日".split()[datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday()]
			template_values = {'data': c,
								'youbi': youbi,
								'clstag': tt.getClsTag(),
								'snktag': tt.getSankaTag(),
							}
			path = os.path.join(os.path.dirname(__file__), 'templates/edit.html')
			path = os.path.join(os.path.dirname(__file__), 'templates/edits.html' if define.isMobile(self) else 'templates/edit.html')
			self.response.out.write(template.render(path, template_values))
		except:
			self.redirect('/')