Exemple #1
0
 def get(self, key):
     go = '/'
     member = CheckAuth(request)
     if member:
         member = db.get(member.key())
         one = db.get(db.Key(key))
         if one:
             if one.num != member.num:
                 try:
                     blocked = pickle.loads(member.blocked.encode('utf-8'))
                 except:
                     blocked = []
                 if len(blocked) == 0:
                     blocked = []
                 if one.num not in blocked:
                     blocked.append(one.num)
                 member.blocked = pickle.dumps(blocked)
                 member.put()
                 memcache.set('Member_' + str(member.num), member, 86400)
     self.redirect(go)
Exemple #2
0
 def get(self, key):
     go = '/'
     member = CheckAuth(request)
     if member:
         member = db.get(member.key())
         one = db.get(db.Key(key))
         if one:
             if one.num != member.num:
                 try:
                     blocked = pickle.loads(member.blocked.encode('utf-8'))
                 except:
                     blocked = []
                 if len(blocked) == 0:
                     blocked = []
                 if one.num not in blocked:
                     blocked.append(one.num)
                 member.blocked = pickle.dumps(blocked)
                 member.put()
                 memcache.set('Member_' + str(member.num), member, 86400)
     self.redirect(go)
Exemple #3
0
    def get(self, key):
        go = '/'
        member = CheckAuth(request)
        if member:
            member = db.get(member.key())
            one = db.get(db.Key(key))
            if one:
                if one.num != member.num:
                    try:
                        blocked = pickle.loads(member.blocked.encode('utf-8'))
                    except:
                        blocked = []
                    if len(blocked) == 0:
                        blocked = []
                    if one.num in blocked:
                        blocked.remove(one.num)
                    member.blocked = pickle.dumps(blocked)
                    member.put()
                    memcache.set('Member_' + str(member.num), member, 86400)
        self.redirect(go)


#def main():
#    application = webapp.WSGIApplication([
#    ('/member/([a-z0-9A-Z\_\-]+)', MemberHandler),
#    ('/member/([a-z0-9A-Z\_\-]+).json', MemberApiHandler),
#    ('/settings', SettingsHandler),
#    ('/settings/password', SettingsPasswordHandler),
#    ('/settings/avatar', SettingsAvatarHandler),
#    ('/block/(.*)', MemberBlockHandler),
#    ('/unblock/(.*)', MemberUnblockHandler)
#    ],
#                                         debug=True)
#    util.run_wsgi_app(application)
#
#
#if __name__ == '__main__':
#    main()
Exemple #4
0
    def get(self, key):
        go = '/'
        member = CheckAuth(request)
        if member:
            member = db.get(member.key())
            one = db.get(db.Key(key))
            if one:
                if one.num != member.num:
                    try:
                        blocked = pickle.loads(member.blocked.encode('utf-8'))
                    except:
                        blocked = []
                    if len(blocked) == 0:
                        blocked = []
                    if one.num  in blocked:
                        blocked.remove(one.num)
                    member.blocked = pickle.dumps(blocked)
                    member.put()
                    memcache.set('Member_' + str(member.num), member, 86400)
        self.redirect(go)

#def main():
#    application = webapp.WSGIApplication([
#    ('/member/([a-z0-9A-Z\_\-]+)', MemberHandler),
#    ('/member/([a-z0-9A-Z\_\-]+).json', MemberApiHandler),
#    ('/settings', SettingsHandler),
#    ('/settings/password', SettingsPasswordHandler),
#    ('/settings/avatar', SettingsAvatarHandler),
#    ('/block/(.*)', MemberBlockHandler),
#    ('/unblock/(.*)', MemberUnblockHandler)
#    ],
#                                         debug=True)
#    util.run_wsgi_app(application)
#
#
#if __name__ == '__main__':
#    main()