def insert_file(self, file):
        """insert_file(file)

        Load resources entries from FILE, and insert them into the
        database.  FILE can be a filename (a string)or a file object.

        """

        if type(file) is bytes:
            file = open(file, 'r')

        self.insert_string(file.read())
insert_file(file)

        Load resources entries from FILE, and insert them into the
        database.  FILE can be a filename (a string)or a file object.