class File:

    def __init__(self):
        pass

    def load_file(self, filename):
        self._filename = filename
        try:
            file = open(self._filename, 'r')
        except IOError, e:
            #TODO: Is this really needed?
            print e.message
            return

        content = file.read()
        file.close()

        self.parse_in(self.split_content(content))

        return content

    def save_file(self, filename=None):
        if filename is not None:
            self._filename = filename

        try:
            result_file = open(self._filename, 'w')
        except IOError, e:
            #TODO: Is this really needed?
            print e.message
            return

        result_file.writelines(self.parse_out())
        result_file.close()

    def split_content(self, content):
        return content.splitlines()

    def get_filename(self): return self._filename

    def parse_in(self, content):
        raise NotImplementedError

    def parse_out(self):
        raise NotImplementedError

