Example #1
0
        def GET(self):
		host = web.ctx.host
		if host.find('.xn--') != -1:
			try:
					import re
					pattern = re.compile("xn--(.*)\.xn--")
					res = pattern.search(host).groups()
					pcode = res[0]
					print pcode
					cd = decode(pcode)
					cd = cd.encode('utf-8')
					ss = ''
					for w in cd:
							print ord(w)
							ss += str(ord(w))+','
					k = getKeyFromEmoji(ss)
					k=emoji2key(k)
					u = getUrl(k)
					if u.find('http://')==-1:
						u = 'http://'+u
					raise web.seeother(u)
			except Exception as e:
					import traceback
					print traceback.format_exc()
		render = web.template.render('templates')
		return render.index()
Example #2
0
 def GET(self, key):
     key = key.replace('/', '')
     u = getUrl(key)
     if u.find('http://') == -1 and u.find("https://") == -1:
         u = 'http://' + u
     raise web.seeother(u)
Example #3
0
	def GET(self,key):
		key = key.replace('/','')
		u = getUrl(key)
		raise web.seeother(u)
Example #4
0
File: index.py Project: bianle/dzml
 def GET(self, key):
     key = key.replace("/", "")
     u = getUrl(key)
     if u.find("http://") == -1 and u.find("https://") == -1:
         u = "http://" + u
     raise web.seeother(u)
Example #5
0
    def GET(self,key):
        key = key.replace('/','')
        u = getUrl(key)
	if u.find('http://')==-1:
		u='http://'+u
        raise web.seeother(u)