@@ -0,0 +1,1822 @@
+# Copyright 2014 Rico Antonio Felix%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# You may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0Afrom DatabaseConnection import DatabaseConnection%0Afrom BankAccount import BankAccount%0A%0A%0Aclass RecordsLoader:%0A    %22%22%22Loads bank account records from local database file%22%22%22%0A%0A    @staticmethod%0A    def load_records(database_file):%0A        %22%22%22%5C%0A        Opens the specified local database file with the bank account records and store the%0A        records in-memory for usage with the aid of the dictionary data structure.%0A%0A        Checks that the argument 'database_file' passed in is of type 'str' else an 'Exception' is raised.%0A%0A        :param database_file: Name of the database file to load records from%0A        :return: Dictionary data structure with the bank account records%0A        %22%22%22%0A        if type(database_file) != str:%0A            raise Exception(%0A                %22Invalid argument: database_file of type %7B%7D should be: %3Cclass 'str'%3E%22.format(type(database_file)))%0A        records = dict()%0A        database = DatabaseConnection(database_file)%0A        result_set = database.sql_statement(database.READ, %22SELECT * FROM accounts%22)%0A        for record in result_set:  # grab each record from the result-set%0A            records%5Brecord%5B4%5D%5D = BankAccount(record%5B0%5D, record%5B1%5D, record%5B2%5D, record%5B3%5D)%0A        database.close()%0A        return records%0A

Create RecordsLoader.py