当前位置: 首页>>代码示例>>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;未经允许,请勿转载。