Esempio n. 1
0
    def family_of(self,surname,given):
        """Show matching records sharing a family with a person who matches
        the surname and given name substrings.

        """
        self.print_header('Family of %s %s' % (given,surname))
        for e in self.g.element_list():
            q = gedcom.Query(e)
            if q.individual():
                if q.surname_match(surname) and q.given_match(given):
                    for f in q.families():
                        for e in gedcom.Query(f).get_family():
                            self.print_record(e)
Esempio n. 2
0
 def marriage_range(self,year1,year2):
     """Show matching records for a marriage year range."""
     self.print_header('Married %d - %d' % (year1,year2))
     for e in self.g.element_list():
         q = gedcom.Query(e)
         if q.individual():
             if q.marriage_range_match(year1,year2):
                 self.print_record(e)
Esempio n. 3
0
 def death(self,year):
     """Show matching records for a death year."""
     self.print_header('Died %d' %(year))
     for e in self.g.element_list():
         q = gedcom.Query(e)
         if q.individual():
             if q.death_year_match(year):
                 self.print_record(e)
Esempio n. 4
0
 def birth_range(self,year1,year2):
     """Show matching records for a birth year range."""
     self.print_header('Born %d - %d' % (year1,year2))
     for e in self.g.element_list():
         q = gedcom.Query(e)
         if q.individual():
             if q.birth_range_match(year1,year2):
                 self.print_record(e)
Esempio n. 5
0
 def given(self,match):
     """Show matching records for a given name substring."""
     self.print_header('Given - %s' % (match))
     for e in self.g.element_list():
         q = gedcom.Query(e)
         if q.individual():
             if q.given_match(match):
                 self.print_record(e)
Esempio n. 6
0
 def surname(self,match):
     """Show matching records for a surname substring."""
     self.print_header('Surname - %s' % (match))
     for e in self.g.element_list():
         q = gedcom.Query(e)
         if q.individual():
             if q.surname_match(match):
                 self.print_record(e)
Esempio n. 7
0
 def print_record(self,e):
     """Print an element."""
     if self.info == 'names':
         q = gedcom.Query(e)
         (first,last) = q.name()
         try:
             print (first, last)
         except UnicodeEncodeError:
             pass
     elif self.info == 'gedcom':
         print (e.get_individual())
Esempio n. 8
0
    def criteria_match(self,criteria):
        """Show matching records using a general criteria. The format
        is [field1]=[value2]:[field2]=[value2]...

        Valid fields are:

        surname, name, birth, birthrange, death, deathrange, marriage,
        marriagerange

        """
        self.print_header('Criteria Matching: %s' % (criteria))
        for e in self.g.element_list():
            q = gedcom.Query(e)
            if q.individual():
                if q.criteria_match(criteria):
                    self.print_record(e)