當前位置: 首頁>>代碼示例>>Python>>正文


Python Protocol.getFullResult方法代碼示例

本文整理匯總了Python中protocol.Protocol.getFullResult方法的典型用法代碼示例。如果您正苦於以下問題:Python Protocol.getFullResult方法的具體用法?Python Protocol.getFullResult怎麽用?Python Protocol.getFullResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在protocol.Protocol的用法示例。


在下文中一共展示了Protocol.getFullResult方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from protocol import Protocol [as 別名]
# 或者: from protocol.Protocol import getFullResult [as 別名]

#.........這裏部分代碼省略.........
            except ObjectDoesNotExist:
                OKVEDObj = OkvedCodes(code=OKVED, description=OKVEDstr[len(OKVED)].strip(), parent=None)
                OKVEDObj.save()
            try:
                OKDPObj = OKDPCodes.objects.get(code=OKDP)
            except ObjectDoesNotExist:
                print("\tOKDP Code %s not found.Saved" % OKDP)
                OKDPObj = OKDPCodes(code=OKDP, description=OKDPstr[len(OKDP):].strip())
                OKDPObj.save()
            try:
                print("LOT %s" % name)
                lotObj = Lot.objects.get(name=name, purchase_fk=purchaseObj)
                print("\tFound")
            except ObjectDoesNotExist:
                print("\tNot Found")
                lotObj = Lot(name=name
                            , joint=joint \
                            , startPrice=priceValue \
                            , OKVED_fk=OKVEDObj \
                            , OKDP_fk=OKDPObj
                            , purchase_fk=purchaseObj)
                lotObj.save()


        ##############################
        ## CHECK IF PROTOCOL EXISTS ##
        ##############################

        protocolparam = purchasePageParser.getLastProtocolUrl()
        print("Protocol")
        if protocolparam is not None:
            print("\tFound")
            protocolPageParser = ProtocolPageParser(protocolparam)
            for applicant in protocolPageParser.getFullResult():
                applicantParams = applicant.get(u"Участник")
                if applicantParams is None:
                    ## NO APPLICANTS ##
                    print("\tNo applicants -> Next")
                    break
                priceParams = applicant.get(u"Предложенная цена договора")
                publicTime = applicant.get(u"Дата и время получения заявки")
                admission = applicant.get(u"Допуск")
                place = applicant.get(U"Результат")
                isLegalEntity = applicant.get(u"Юридическое лицо")
                isIndividual = applicant.get(u"Физическое лицо")
                notRussianResident = applicant.get(u"Не резидент")
                try:
                    innIndex = applicantParams.index(u"ИНН")
                    INN = ''.join(x for x in applicantParams[innIndex:] if x.isdigit())
                    innValueEnd = applicantParams.index(INN) + len(INN)
                    applicantParams = applicantParams[0: innIndex] + applicantParams[innValueEnd:]
                except ValueError:
                    INN = u""
                try:
                    KPPIndex = applicantParams.index(u"КПП")
                    KPP = ''.join(x for x in applicantParams[KPPIndex:] if x.isdigit())
                    KPPValueEnd = applicantParams.index(KPP) + len(KPP)
                    applicantParams = applicantParams[0: KPPIndex] + applicantParams[KPPValueEnd:]
                except ValueError:
                    KPP = u""
                name = applicantParams.strip()


                ###########################
                ## GET APPLICANT COMPANY ##
                ###########################
開發者ID:pasha0220,項目名稱:gosinfo,代碼行數:70,代碼來源:main.py


注:本文中的protocol.Protocol.getFullResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。