Beispiel #1
0
 def __init__(self):
     '''
     Simple constructor of the database
     '''
     gen_database.__init__(self)
     self.equivalence = {}
     self.inmediate = {}
Beispiel #2
0
 def __init__(self, gedcomfile = None):
     '''
     Constructor of the database introducing as input the database
     '''
     gen_database.__init__(self)
     if gedcomfile:
         f = open(gedcomfile, "r")
         self.gedcom = recursive_analysis(f, 0)
         f.close()
     else:
         #In this case there is not database, so requires creation
         self.gedcom = {}
         self.gedcom["HEAD"] = {'SOUR': {'NAME': {'VALUE': 'Created using https://github.com/Thimxx/pyGenealogical-Tools'}}}
         self.gedcom["GEDC"] = {'VERS': {'VALUE': '5.5'}}
         self.gedcom["TRLR"] = {}
     id_found = False
     count_prof = 0
     while not id_found:
         if "@" + CHAR_PROF + str(count_prof + 1) + "@" in self.gedcom.keys():
             count_prof += 1
         else:
             self.count_prof = count_prof
             id_found = True
     id_found = False
     count_fam = 0
     while not id_found:
         if "@" + CHAR_PROF + str(count_fam + 1) + "@" in self.gedcom.keys():
             count_fam += 1
         else:
             self.count_fam = count_fam
             id_found = True
     self.count_fam = 0
Beispiel #3
0
 def __init__(self, db_file):
     '''
     Construction, taking as initial parameter the location of the database
     '''
     gen_database.__init__(self)
     self.database = None
     self.right_read = False
     #Open database and get it as part of the class
     self.database = sqlite3.connect(db_file)
Beispiel #4
0
 def __init__(self):
     '''
     Simple constructor of the database
     '''
     #We initiate the base classes
     geni_calls.__init__(self)
     gen_database.__init__(self)
     self.equivalence = {}
     self.inmediate = {}