Exemplo n.º 1
0
 def _load_friend(self, email, passwd):
     res = msn_friend_get(email, passwd)
     if res:
         invite_email_new(self.current_user_id, CID_MSN, res)
         return self.finish(jsonp(self, dumps({'error':False, 'next':invite_user_id_by_cid(self.current_user_id, CID_MSN)})))
     else:
         return self.finish(jsonp(self, dumps({'error':'邮箱或密码错误'})))
Exemplo n.º 2
0
 def _load_friend(self, email, passwd):
     res = msn_friend_get(email, passwd)
     if res:
         invite_email_new(self.current_user_id, CID_MSN, res)
         return self.finish(
             jsonp(
                 self,
                 dumps({
                     'error':
                     False,
                     'next':
                     invite_user_id_by_cid(self.current_user_id, CID_MSN)
                 })))
     else:
         return self.finish(jsonp(self, dumps({'error': '邮箱或密码错误'})))
Exemplo n.º 3
0
 def get(self):
     email = self.get_argument('email', None)
     passwd = self.get_argument('passwd', None)
     url = 'http://%s.%s' % (self.current_user_id, SITE_DOMAIN)
     if email and passwd:
         thread.start_new_thread(self._load_friend, (email, passwd))
     else:
         return self.finish(jsonp(self, dumps({'error': '输入正确的邮箱和密码'})))
Exemplo n.º 4
0
    def get(self):
        q = self.get_argument('q',None)
        if q:
            result = dumps((int(i[0]),int(i[1]),escape(i[2])) for i in autocomplete_tag.id_rank_name_list_by_str(q)) 
        else:
            result = []

        self.finish(jsonp(self,result))
Exemplo n.º 5
0
    def get(self):
        q = self.get_argument('q',None)
        if q:
            result = autocomplete(q)
            result = dumps(result) 
        else:
            result = []

        self.finish(jsonp(self,result))
Exemplo n.º 6
0
 def get(self, id):
     if not id.isdigit():
         _blog_ping(self)
         id = user_id_by_mail(id) or 0
     self.finish(
         jsonp(
             self,
             man_show_api_json(int(id))
         )
     )
Exemplo n.º 7
0
    def get(self):
        q = self.get_argument('q', None)
        if q:
            result = dumps(
                (int(i[0]), int(i[1]), escape(i[2]))
                for i in autocomplete_tag.id_rank_name_list_by_str(q))
        else:
            result = []

        self.finish(jsonp(self, result))
Exemplo n.º 8
0
 def get(self):
     email = self.get_argument('email', None)
     passwd = self.get_argument('passwd', None)
     url = 'http://%s.%s'%(self.current_user_id, SITE_DOMAIN)
     if email and passwd:
         thread.start_new_thread(
         self._load_friend,
         (email, passwd)
         )
     else:
         return self.finish(jsonp(self, dumps({'error':'输入正确的邮箱和密码'})))
Exemplo n.º 9
0
    def get(self):
        _blog_ping(self)

        next = self.get_argument('next', None)
        if next:
            back = self.get_argument('back', None)
            redirect_to = urlparse.urlunsplit(
                ('http', SITE_DOMAIN, urlparse.urlsplit(next).path,
                 urllib.urlencode({'back': back}) if back else '', ''))
            return self.redirect(redirect_to)

        self.finish(jsonp(self, '{}'))
Exemplo n.º 10
0
def _get(self, func):
    key = self.get_argument('q', None)
    user_id = self.current_user_id
    result = []
    if user_id:
        name_dict, url_dict = func(user_id)
        id_list = zsite_by_key(key, name_dict, url_dict, 7)
        zsite_list = Zsite.mc_get_list(id_list)
        ico_url_bind_with_default(zsite_list)
        career_bind(zsite_list)

        for i in zsite_list:
            li = (i.name, ','.join(i.career), url_or_id(i.id), i.ico)
            result.append(li)
    #print result
    self.finish(jsonp(self, dumps(result)))
Exemplo n.º 11
0
    def get(self):
        _blog_ping(self)

        next = self.get_argument('next', None)
        if next:
            back = self.get_argument('back', None)
            redirect_to = urlparse.urlunsplit(
                (
                    'http',
                    SITE_DOMAIN,
                    urlparse.urlsplit(next).path,
                    urllib.urlencode({'back': back}) if back else '',
                    ''
                )
            )
            return self.redirect(redirect_to)

        self.finish(jsonp(self, '{}'))
Exemplo n.º 12
0
 def get(self, key):
     self.set_header('Content-Type', 'image/png; charset=gbk')
     self.finish(jsonp(self, dumps(str(mc.get(key)))))
Exemplo n.º 13
0
 def _on_get(self, r):
     if r is None:
         r = '{"error":"result is None"}'
     self.finish(jsonp(self, dumps(r)))
Exemplo n.º 14
0
 def get(self, id):
     if not id.isdigit():
         _blog_ping(self)
         id = user_id_by_mail(id) or 0
     self.finish(jsonp(self, man_show_api_json(int(id))))
Exemplo n.º 15
0
 def get(self, key):
     self.set_header('Content-Type', 'image/png; charset=gbk')
     self.finish(jsonp(self, dumps(str(mc.get(key)))))
Exemplo n.º 16
0
 def _on_get(self, r):
     if r is None:
         r = '{"error":"result is None"}'
     self.finish(jsonp(self, dumps(r)))