コード例 #1
0
ファイル: interface.py プロジェクト: wangjian2254/mogu2
 def get(self):
     try:
         m = self.request.get("MainCode")
         code = self.request.get("Code")
         c = code.split("-")
         if len(c) == 0 or c[0] != m:
             self.response.out.write("1")
             return
         if not checkUser(self):
             self.response.out.write("1")
             return
         #            try:
         if "a999-9-s1-1" == code:
             return doRePassWord(self)
         if "a999-2-s1" == code:
             return doShouQuan(self)
         if "a888" == m:
             return doDingYue(self)
     #            if 'a999-2-s1' == code:
     #                return doShouQuan(self)
     #                if 'a1'==self.request.get('MainCode'):
     #                    return ToA1(self)
     #                if 'a3'==self.request.get('MainCode') or 'a33'==self.request.get('MainCode'):
     #                    return A3replay(self)#对微博的回复处理,
     #                    self.redirect('/RssChangeScribe'+parm,permanent=True)
     except Exception, e:
         logging.error("reply:" + str(e))
         self.response.out.write("1")
         return
コード例 #2
0
ファイル: interface.py プロジェクト: wangjian2254/mogu2
    def get(self):
        if not checkUser(self):
            self.response.out.write("1")
            return
        userName = self.request.get("UserName").strip()
        xml = None
        datas = None
        codeListAll = []  # 全要型的订阅
        codeListPart = []  # 只要本层订阅方式
        deleteListCode = []
        for sub in Subscribe.all().filter("userName in", [userName, "000"]).filter("status =", "1"):
            if "0" == sub.subscribeType:
                codeListAll.append(sub.code)
            codeListPart.append(sub.code)

        xml, datas = infoallxmldic(ContentClass.get_by_key_name(codeListPart), xml, datas)
        for c in codeListAll:
            xml, datas = infoallxmldic(findChildNodes(c).filter("userName ="******""), xml, datas)
        xml, datas = infoallxmldic(
            ContentClass.all().filter("userName ="******"status =", "1"), xml, datas
        )
        datas.setAttribute("type", "infoall")
        datas.setAttribute("code", "main")
        datas.setAttribute("verson", AppPhoneVerson)
        datas.setAttribute("download", AppPhoneUri)
        userAppData(userName, datas)
        self.response.out.write(xml.toxml("utf-8"))
        return
コード例 #3
0
ファイル: interface.py プロジェクト: wangjian2254/mogu2
 def get(self):
     if not checkUser(self):
         self.response.out.write("1")
         return
     userName = self.request.get("UserName").strip()
     xml = None
     datas = None
     userUpdate = UserUpdate.get_by_userName(userName)
     codeListPart = userUpdate.updateContent  # 只要本层订阅方式
     codeListAll = []  # 全要型的订阅
     codeListDelete = []
     for sub in Subscribe.get_by_key_name(userUpdate.updateSubscribe):
         if "0" == sub.status:
             codeListDelete.append(sub.code)
         else:
             if "0" == sub.subscribeType:
                 codeListAll.append(sub.code)
             codeListPart.append(sub.code)
     xml, datas = infoallxmldic(ContentClass.get_by_key_name(codeListPart), xml, datas)
     for c in codeListAll:
         xml, datas = infoallxmldic(findChildNodes(c, "1").filter("userName ="******""), xml, datas)
     xml, datas = infoallxmldic(codeListDelete, xml, datas, True)
     datas.setAttribute("type", "infoupdate")
     userAppData(userName, datas)
     self.response.out.write(xml.toxml("utf-8"))
     userUpdate.updateSubscribe = []
     userUpdate.updateContent = []
     userUpdate.put()
     return