def post(self):

		revisions =  json.loads(self.request.get("revisions"))
		ret = {}
		c = 0
		for dic in revisions:
			cfile = dic['file']
			rev_dic = dic['revision']

			query = db.GqlQuery("SELECT * FROM  AeroFile where directory = :1 and file_name = :2", cfile['directory'], cfile['file_name'])
			fileOb = query.get()
			if not fileOb:

				dated = datetime.datetime.strptime(rev_dic['date'], "%Y/%m/%d %H:%M:%S") #"date": "2008/09/22 23:08:47"
				fileOb = AeroFile()
				fileOb.file_name = cfile['file_name']
				fileOb.directory = cfile['directory']
				fileOb.revision = rev_dic['revision']
				fileOb.message = rev_dic['message']
				fileOb.updated = dated
				fileOb.put()

			#### revision
			

			## check author
			query = db.GqlQuery("SELECT * FROM  Developer where cvs = :1", rev_dic['author'])
			devOb = query.get()
			if not devOb:
				devOb = Developer()	
				devOb.cvs = rev_dic['author']
				devOb.put()
Esempio n. 2
0
	def get(self, action=None):
		query = Developer.all()
		devs = query.fetch(1000)
		template_values = {
			'conf': conf, 'path': self.request.path, 'title': 'Developers',
			'devs': devs
		}

		path = os.path.join(os.path.dirname(__file__), 'templates/developers.html')
		self.response.out.write(template.render(path, template_values))