<commit_before>from google.appengine.ext.webapp import template
from operator import itemgetter, attrgetter
import datetime
import operator 
import webapp2
import json
from models.link import Link
from models.user import User

class IndexHandler(webapp2.RequestHandler):
	def get(self):
		user = None
		if self.request.cookies.get('our_token'):    #the cookie that should contain the access token!
			user = User.checkToken(self.request.cookies.get('our_token'))
		if not user:
			html = template.render("web/templates/index.html", {})
			self.response.write(html)
			return
		linkslist=Link.getAllLinksPerUser(user)	
		#sorted(linkslist, key=lambda link: link.time_of_enter_the_link')   # sort by age
		urls = []
		template_params = {}
		if linkslist:
			for link in linkslist:
				url = link.url_link
				des = link.description
				datatime=link.time_of_enter_the_link
				fromlink=link.from_link
				if fromlink is None:
					if link.ifInTheGroup == False:
						urlandlink =[url,des,datatime]
						urls.append(urlandlink)
			template_params['urls'] = urls
		template_params['useremail'] = user.email
		html = template.render("web/templates/mysavedlinks.html", template_params)
		self.response.write(html)
		return

		
class addNewLink(webapp2.RequestHandler):
	def get(self):
		template_params = {}
		description = self.request.get('description')
		url_link = self.request.get('url_link')
		user = None
		if self.request.cookies.get('our_token'):    #the cookie that should contain the access token!
			user = User.checkToken(self.request.cookies.get('our_token'))<commit_msg>change newurls in mysavedlinks<commit_after>from google.appengine.ext.webapp import template
from operator import itemgetter, attrgetter
import datetime
import operator 
import webapp2
import json
from models.link import Link
from models.user import User

class IndexHandler(webapp2.RequestHandler):
	def get(self):
		user = None
		if self.request.cookies.get('our_token'):    #the cookie that should contain the access token!
			user = User.checkToken(self.request.cookies.get('our_token'))
		if not user:
			html = template.render("web/templates/index.html", {})
			self.response.write(html)
			return
		#newlinks
		linkslist=Link.getAllLinksPerUser(user)	
		newurls = []
		template_params = {}
		if linkslist:
			for link in linkslist:
				url = link.url_link
				des = link.description
				fromlink=link.from_link
				if fromlink is not None:
					urlandlink =[url,des,fromlink]
					newurls.append(urlandlink)
			template_params['newurls'] = newurls
		#newlinks
		linkslist=Link.getAllLinksPerUser(user)	
		#sorted(linkslist, key=lambda link: link.time_of_enter_the_link')   # sort by age
		urls = []
		template_params = {}
		if linkslist:
			for link in linkslist:
				url = link.url_link
				des = link.description
				datatime=link.time_of_enter_the_link
				fromlink=link.from_link
				if fromlink is None:
					if link.ifInTheGroup == False:
						urlandlink =[url,des,datatime]
						urls.append(urlandlink)
			template_params['urls'] = urls
		template_params['useremail'] = user.email
		html = template.render("web/templates/mysavedlinks.html", template_params)
		self.response.write(html)
		return

		
class addNewLink(webapp2.RequestHandler):
	def get(self):
		template_params = {}
		description = self.request.get('description')
		url_link = self.request.get('url_link')
		user = None
		if self.request.cookies.get('our_token'):    #the cookie that should contain the access token!
			user = User.checkToken(self.request.cookies.get('our_token'))
{'fraction_non_alphanumeric': 0.10446075663466968, 'fraction_numerical': 0.0016939582156973462, 'mean_word_length': 4.3278195488721805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4195921', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1146, 'n_words': 256}