deleteme/database.py
def populate_tables(self, dump=None):
        '''
        Populate programmatically the tables from a dump file.

        :param dump:  path to the .sql dump file. If this parmeter is
            None, then *db/deleteme_data_dump.sql* is utilized.

        '''
        con = sqlite3.connect(self.db_path)
        #Activate foreing keys support
        cur = con.cursor()
        #Populate database from dump
        if dump is None:
            dump = DEFAULT_DATA_DUMP
        try:
            with open (dump, encoding="utf-8") as f:
                sql = f.read()
                cur = con.cursor()
                cur.executescript(sql)
        finally:
            con.close()

        Populate programmatically the tables from a dump file.

        :param dump:  path to the .sql dump file. If this parmeter is
            None, then *db/deleteme_data_dump.sql* is utilized.

        
Populate programmatically the tables from a dump file.
Populate programmatically the tables from a dump file .
def populate_tables(self, dump=None):
        con = sqlite3.connect(self.db_path)
        cur = con.cursor()
        if dump is None:
            dump = DEFAULT_DATA_DUMP
        try:
            with open (dump, encoding="utf-8") as f:
                sql = f.read()
                cur = con.cursor()
                cur.executescript(sql)
        finally:
            con.close()
def populate_tables ( self , dump = None ) : con = sqlite3 . connect ( self . db_path ) cur = con . cursor ( ) if dump is None : dump = DEFAULT_DATA_DUMP try : with open ( dump , encoding = "utf-8" ) as f : sql = f . read ( ) cur = con . cursor ( ) cur . executescript ( sql ) finally : con . close ( )
Populate programmatically the tables from a dump file.
Populate programmatically the tables from a dump file .
'''
        Populate programmatically the tables from a dump file.

        :param dump:  path to the .sql dump file. If this parmeter is
            None, then *db/deleteme_data_dump.sql* is utilized.

        ''' #Activate foreing keys support #Populate database from dump
self
dump
path to the .sql dump file. If this parmeter is
None, then *db/deleteme_data_dump.sql* is utilized.
path to the . sql dump file . If this parmeter is None then * db / deleteme_data_dump . sql * is utilized .