Ejemplo n.º 1
0
 def test_applicationNumberAsTuple(self):
     an1 = 'EP12345'
     an2 = '12345'
     an3 = 'PCT/GB2016/12345'
     an4 = 'us - 12345'
     an5 = 'US 61/678,367'
     an6 = 'EP 12005594.2'
     
     self.assertEqual(('EP', '12345'), cu.applicationNumberAsTuple(an1))
     self.assertEqual(('XX', '12345'), cu.applicationNumberAsTuple(an2))
     self.assertEqual(('PC', 'T/GB2016/12345'), cu.applicationNumberAsTuple(an3))
     self.assertEqual(('us', '- 12345'), cu.applicationNumberAsTuple(an4))
     self.assertEqual(('US', '61/678,367'), cu.applicationNumberAsTuple(an5))
     self.assertEqual(('EP', '12005594.2'), cu.applicationNumberAsTuple(an6))
Ejemplo n.º 2
0
    def getSequenceListingSt26(self, aSeql_st25):

#         set first applicant value
        aSeql_st25_applicant = aSeql_st25.generalInformation.applicant
        if aSeql_st25_applicant:
            seql_st26_applicantName = aSeql_st25_applicant[0]
        else:
            seql_st26_applicantName = seqlutils.DEFAULT_STRING

#         set applicationNumber as a tuple
        applicationNumberAsTuple = converter_util.applicationNumberAsTuple(aSeql_st25.generalInformation.applicationNumber)

#         set filingDate
        fd = self.seql_st25.generalInformation.filingDate
        if fd != seqlutils.DEFAULT_STRING:
            filingDateAsString = fd 
        else:
            filingDateAsString = converter_util.DEFAULT_DATE_STRING
        
#         set earliest priority 
        priorityNumberAsTuple = ('', '')
        priorityDate = converter_util.DEFAULT_DATE_STRING
                
        aSeql_st25_priority = aSeql_st25.generalInformation.priority
        
        if aSeql_st25_priority:
            firstPriority = aSeql_st25_priority[0]
            priorityNumberAsTuple = converter_util.applicationNumberAsTuple(firstPriority[0])
            priorityDateAsString = firstPriority[1]
            priorityDate = datetime.datetime.strptime(priorityDateAsString, '%Y-%m-%d').date()
        
#         create SequenceListing instance
        sl = Seql_st26(
                fileName = '%s_converted' % self.fileName,
                dtdVersion = '1',
                softwareName = 'prototype',
                softwareVersion = '0.1',
                productionDate = timezone.now().date(),
                  
                applicantFileReference = aSeql_st25.generalInformation.reference,
#                 applicantFileReference = applicantFileReference,
                
                IPOfficeCode = applicationNumberAsTuple[0],
                applicationNumberText = applicationNumberAsTuple[1],
                filingDate = datetime.datetime.strptime(filingDateAsString, '%Y-%m-%d').date(),
                earliestPriorityIPOfficeCode = priorityNumberAsTuple[0],
                earliestPriorityApplicationNumberText = priorityNumberAsTuple[1],
                earliestPriorityFilingDate = priorityDate,
               
                applicantName = seql_st26_applicantName,
                applicantNameLanguageCode = converter_util.DEFAULT_CODE,
                applicantNameLatin = seql_st26_applicantName,
                
                inventorName = '-',
                inventorNameLanguageCode = converter_util.DEFAULT_CODE,
                inventorNameLatin = '-', 
                
#                 sequenceTotalQuantity = aSeql_st25.generalInformation.quantity       
                ) 
        sl.save()
        return sl 
Ejemplo n.º 3
0
    def getSequenceListingSt26(self, aSeql_st25):

#         set first applicant value
        aSeql_st25_applicant = aSeql_st25.applicant
        if aSeql_st25_applicant:
            seql_st26_applicantName = aSeql_st25_applicant[0]
        else:
            seql_st26_applicantName = seqlutils.DEFAULT_STRING

#         set applicationNumber as a tuple
        applicationNumberAsTuple = converter_util.applicationNumberAsTuple(aSeql_st25.applicationNumber)

#         set filingDate
        fd = self.seql_st25.filingDate

        dateRegex = r'\d\d\d\d-\d\d-\d\d'
        datePattern = re.compile(dateRegex)
        
        if datePattern.match(fd):
            filingDateAsString = fd 
        else:
            filingDateAsString = converter_util.DEFAULT_DATE_STRING
        
#         set earliest priority 
        priorityNumberAsTuple = ('', '')
        priorityDate = converter_util.DEFAULT_DATE_STRING
                
        aSeql_st25_priority = aSeql_st25.priorities
        
        if aSeql_st25_priority:
            firstPriority = aSeql_st25_priority[0]
            priorityNumberAsTuple = converter_util.applicationNumberAsTuple(firstPriority[0])
            priorityDateAsString = firstPriority[1]
            priorityDate = datetime.datetime.strptime(priorityDateAsString, '%Y-%m-%d').date()
        
#         create SequenceListing instance
        sl = Seql_st26(
                fileName = '%s_ST26' % self.fileName,
                dtdVersion = '1',
                softwareName = 'prototype',
                softwareVersion = '0.1',
                productionDate = timezone.now().date(),
                  
                applicantFileReference = aSeql_st25.reference,
                               
                applicantName = seql_st26_applicantName,
                applicantNameLanguageCode = converter_util.DEFAULT_CODE,

                ) 
        sl.save()
        
        if aSeql_st25.applicationNumber != converter_util.BLANK_PLACEHOLDER:
            sl.IPOfficeCode = applicationNumberAsTuple[0]
            sl.applicationNumberText = applicationNumberAsTuple[1]
            sl.filingDate = datetime.datetime.strptime(filingDateAsString, '%Y-%m-%d').date()
            sl.save()
        
        #         set earliest priority 
        priorityNumberAsTuple = ('', '')
        priorityDate = converter_util.DEFAULT_DATE_STRING
                
        aSeql_st25_priority = aSeql_st25.priorities
        
        if aSeql_st25_priority:
            firstPriority = aSeql_st25_priority[0]
            priorityNumberAsTuple = converter_util.applicationNumberAsTuple(firstPriority[0])
            priorityDateAsString = firstPriority[1]
            priorityDate = datetime.datetime.strptime(priorityDateAsString, '%Y-%m-%d').date()
            
            sl.earliestPriorityIPOfficeCode = priorityNumberAsTuple[0]
            sl.earliestPriorityApplicationNumberText = priorityNumberAsTuple[1]
            sl.earliestPriorityFilingDate = priorityDate
            sl.save()
            
        return sl 
Ejemplo n.º 4
0
    def getSequenceListingSt26(self, aSeql_st25):

        #         set first applicant value
        aSeql_st25_applicant = aSeql_st25.applicant
        if aSeql_st25_applicant:
            seql_st26_applicantName = aSeql_st25_applicant[0]
        else:
            seql_st26_applicantName = seqlutils.DEFAULT_STRING

#         set applicationNumber as a tuple
        applicationNumberAsTuple = converter_util.applicationNumberAsTuple(
            aSeql_st25.applicationNumber)

        #         set filingDate
        fd = self.seql_st25.filingDate

        dateRegex = r'\d\d\d\d-\d\d-\d\d'
        datePattern = re.compile(dateRegex)

        if datePattern.match(fd):
            filingDateAsString = fd
        else:
            filingDateAsString = converter_util.DEFAULT_DATE_STRING

#         set earliest priority
        priorityNumberAsTuple = ('', '')
        priorityDate = converter_util.DEFAULT_DATE_STRING

        aSeql_st25_priority = aSeql_st25.priorities

        if aSeql_st25_priority:
            firstPriority = aSeql_st25_priority[0]
            priorityNumberAsTuple = converter_util.applicationNumberAsTuple(
                firstPriority[0])
            priorityDateAsString = firstPriority[1]
            priorityDate = datetime.datetime.strptime(priorityDateAsString,
                                                      '%Y-%m-%d').date()

#         create SequenceListing instance
        sl = Seql_st26(
            fileName='%s_ST26' % self.fileName,
            dtdVersion='1',
            softwareName='prototype',
            softwareVersion='0.1',
            productionDate=timezone.now().date(),
            applicantFileReference=aSeql_st25.reference,
            applicantName=seql_st26_applicantName,
            applicantNameLanguageCode=converter_util.DEFAULT_CODE,
        )
        sl.save()

        if aSeql_st25.applicationNumber != converter_util.BLANK_PLACEHOLDER:
            sl.IPOfficeCode = applicationNumberAsTuple[0]
            sl.applicationNumberText = applicationNumberAsTuple[1]
            sl.filingDate = datetime.datetime.strptime(filingDateAsString,
                                                       '%Y-%m-%d').date()
            sl.save()

        #         set earliest priority
        priorityNumberAsTuple = ('', '')
        priorityDate = converter_util.DEFAULT_DATE_STRING

        aSeql_st25_priority = aSeql_st25.priorities

        if aSeql_st25_priority:
            firstPriority = aSeql_st25_priority[0]
            priorityNumberAsTuple = converter_util.applicationNumberAsTuple(
                firstPriority[0])
            priorityDateAsString = firstPriority[1]
            priorityDate = datetime.datetime.strptime(priorityDateAsString,
                                                      '%Y-%m-%d').date()

            sl.earliestPriorityIPOfficeCode = priorityNumberAsTuple[0]
            sl.earliestPriorityApplicationNumberText = priorityNumberAsTuple[1]
            sl.earliestPriorityFilingDate = priorityDate
            sl.save()

        return sl